@@ -46,7 +46,7 @@ type MockSensor struct {
46
46
processLineages map [string ]LineageMap
47
47
processMutex sync.Mutex
48
48
49
- connections map [string ][]types.NetworkInfoBatch
49
+ connections map [string ][]types.NetworkConnectionBatch
50
50
endpoints map [string ]EndpointMap
51
51
networkMutex sync.Mutex
52
52
@@ -64,7 +64,7 @@ func NewMockSensor(test string) *MockSensor {
64
64
testName : test ,
65
65
processes : make (map [string ]ProcessMap ),
66
66
processLineages : make (map [string ]LineageMap ),
67
- connections : make (map [string ][]types.NetworkInfoBatch ),
67
+ connections : make (map [string ][]types.NetworkConnectionBatch ),
68
68
endpoints : make (map [string ]EndpointMap ),
69
69
}
70
70
}
@@ -149,20 +149,20 @@ func (m *MockSensor) LiveConnections() <-chan *sensorAPI.NetworkConnection {
149
149
150
150
// Connections returns a list of all connections that have been received for
151
151
// a given container ID
152
- func (m * MockSensor ) GetConnectionsInBatches (containerID string ) []types.NetworkInfoBatch {
152
+ func (m * MockSensor ) GetConnectionsInBatches (containerID string ) []types.NetworkConnectionBatch {
153
153
m .networkMutex .Lock ()
154
154
defer m .networkMutex .Unlock ()
155
155
156
156
if connections , ok := m .connections [containerID ]; ok {
157
- conns := make ([]types.NetworkInfoBatch , len (connections ))
157
+ conns := make ([]types.NetworkConnectionBatch , len (connections ))
158
158
copy (conns , connections )
159
159
for _ , conn := range conns {
160
160
types .SortConnections (conn )
161
161
}
162
162
163
163
return conns
164
164
}
165
- return make ([]types.NetworkInfoBatch , 0 )
165
+ return make ([]types.NetworkConnectionBatch , 0 )
166
166
}
167
167
168
168
// Connections returns a list of all connections that have been received for
@@ -173,7 +173,7 @@ func (m *MockSensor) Connections(containerID string) []*sensorAPI.NetworkConnect
173
173
174
174
allConns := make ([]* sensorAPI.NetworkConnection , 0 )
175
175
if connections , ok := m .connections [containerID ]; ok {
176
- conns := make ([]types.NetworkInfoBatch , len (connections ))
176
+ conns := make ([]types.NetworkConnectionBatch , len (connections ))
177
177
copy (conns , connections )
178
178
for _ , conn := range conns {
179
179
allConns = append (allConns , conn ... )
@@ -292,7 +292,7 @@ func (m *MockSensor) Stop() {
292
292
293
293
m .processes = make (map [string ]ProcessMap )
294
294
m .processLineages = make (map [string ]LineageMap )
295
- m .connections = make (map [string ][]types.NetworkInfoBatch )
295
+ m .connections = make (map [string ][]types.NetworkConnectionBatch )
296
296
m .endpoints = make (map [string ]EndpointMap )
297
297
298
298
m .processChannel .Stop ()
@@ -455,7 +455,7 @@ func (m *MockSensor) pushConnections(containerConnsMap map[string][]*sensorAPI.N
455
455
if c , ok := m .connections [containerID ]; ok {
456
456
m .connections [containerID ] = append (c , connections )
457
457
} else {
458
- m .connections [containerID ] = []types.NetworkInfoBatch {connections }
458
+ m .connections [containerID ] = []types.NetworkConnectionBatch {connections }
459
459
}
460
460
}
461
461
}
0 commit comments