1 // Copyright (c) 2021 Cisco and/or its affiliates.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at:
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
21 // Trace gives access to the API trace tool, capturing outcoming and incoming messages
23 type Trace interface {
24 // Enable allows to enable or disable API trace for a connection.
27 // GetRecords retrieves all messages collected (from all channels if they are used)
28 // since the point the trace was enabled or cleared.
29 GetRecords() []*Record
31 // GetRecordsForChannel retrieves messages collected by the given channel since
32 // the point the trace was enabled or cleared.
33 GetRecordsForChannel(chId uint16) []*Record
35 // Clear erases messages captured so far.
39 // Record contains essential information about traced message, its timestamp and whether
40 // the message was received or sent