/
security_module_server.go
491 lines (404 loc) · 14.4 KB
/
security_module_server.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
// Code generated by mockery v2.40.1. DO NOT EDIT.
package mocks
import (
context "context"
api "github.com/DataDog/datadog-agent/pkg/security/proto/api"
mock "github.com/stretchr/testify/mock"
)
// SecurityModuleServer is an autogenerated mock type for the SecurityModuleServer type
type SecurityModuleServer struct {
mock.Mock
}
// DumpActivity provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) DumpActivity(_a0 context.Context, _a1 *api.ActivityDumpParams) (*api.ActivityDumpMessage, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for DumpActivity")
}
var r0 *api.ActivityDumpMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.ActivityDumpParams) (*api.ActivityDumpMessage, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.ActivityDumpParams) *api.ActivityDumpMessage); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.ActivityDumpMessage)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.ActivityDumpParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DumpDiscarders provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) DumpDiscarders(_a0 context.Context, _a1 *api.DumpDiscardersParams) (*api.DumpDiscardersMessage, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for DumpDiscarders")
}
var r0 *api.DumpDiscardersMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.DumpDiscardersParams) (*api.DumpDiscardersMessage, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.DumpDiscardersParams) *api.DumpDiscardersMessage); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.DumpDiscardersMessage)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.DumpDiscardersParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DumpNetworkNamespace provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) DumpNetworkNamespace(_a0 context.Context, _a1 *api.DumpNetworkNamespaceParams) (*api.DumpNetworkNamespaceMessage, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for DumpNetworkNamespace")
}
var r0 *api.DumpNetworkNamespaceMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.DumpNetworkNamespaceParams) (*api.DumpNetworkNamespaceMessage, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.DumpNetworkNamespaceParams) *api.DumpNetworkNamespaceMessage); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.DumpNetworkNamespaceMessage)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.DumpNetworkNamespaceParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DumpProcessCache provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) DumpProcessCache(_a0 context.Context, _a1 *api.DumpProcessCacheParams) (*api.SecurityDumpProcessCacheMessage, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for DumpProcessCache")
}
var r0 *api.SecurityDumpProcessCacheMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.DumpProcessCacheParams) (*api.SecurityDumpProcessCacheMessage, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.DumpProcessCacheParams) *api.SecurityDumpProcessCacheMessage); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.SecurityDumpProcessCacheMessage)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.DumpProcessCacheParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetActivityDumpStream provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) GetActivityDumpStream(_a0 *api.ActivityDumpStreamParams, _a1 api.SecurityModule_GetActivityDumpStreamServer) error {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for GetActivityDumpStream")
}
var r0 error
if rf, ok := ret.Get(0).(func(*api.ActivityDumpStreamParams, api.SecurityModule_GetActivityDumpStreamServer) error); ok {
r0 = rf(_a0, _a1)
} else {
r0 = ret.Error(0)
}
return r0
}
// GetConfig provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) GetConfig(_a0 context.Context, _a1 *api.GetConfigParams) (*api.SecurityConfigMessage, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for GetConfig")
}
var r0 *api.SecurityConfigMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.GetConfigParams) (*api.SecurityConfigMessage, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.GetConfigParams) *api.SecurityConfigMessage); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.SecurityConfigMessage)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.GetConfigParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetEvents provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) GetEvents(_a0 *api.GetEventParams, _a1 api.SecurityModule_GetEventsServer) error {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for GetEvents")
}
var r0 error
if rf, ok := ret.Get(0).(func(*api.GetEventParams, api.SecurityModule_GetEventsServer) error); ok {
r0 = rf(_a0, _a1)
} else {
r0 = ret.Error(0)
}
return r0
}
// GetRuleSetReport provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) GetRuleSetReport(_a0 context.Context, _a1 *api.GetRuleSetReportParams) (*api.GetRuleSetReportResultMessage, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for GetRuleSetReport")
}
var r0 *api.GetRuleSetReportResultMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.GetRuleSetReportParams) (*api.GetRuleSetReportResultMessage, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.GetRuleSetReportParams) *api.GetRuleSetReportResultMessage); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.GetRuleSetReportResultMessage)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.GetRuleSetReportParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetStatus provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) GetStatus(_a0 context.Context, _a1 *api.GetStatusParams) (*api.Status, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for GetStatus")
}
var r0 *api.Status
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.GetStatusParams) (*api.Status, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.GetStatusParams) *api.Status); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.Status)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.GetStatusParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ListActivityDumps provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) ListActivityDumps(_a0 context.Context, _a1 *api.ActivityDumpListParams) (*api.ActivityDumpListMessage, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for ListActivityDumps")
}
var r0 *api.ActivityDumpListMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.ActivityDumpListParams) (*api.ActivityDumpListMessage, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.ActivityDumpListParams) *api.ActivityDumpListMessage); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.ActivityDumpListMessage)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.ActivityDumpListParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ListSecurityProfiles provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) ListSecurityProfiles(_a0 context.Context, _a1 *api.SecurityProfileListParams) (*api.SecurityProfileListMessage, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for ListSecurityProfiles")
}
var r0 *api.SecurityProfileListMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.SecurityProfileListParams) (*api.SecurityProfileListMessage, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.SecurityProfileListParams) *api.SecurityProfileListMessage); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.SecurityProfileListMessage)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.SecurityProfileListParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ReloadPolicies provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) ReloadPolicies(_a0 context.Context, _a1 *api.ReloadPoliciesParams) (*api.ReloadPoliciesResultMessage, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for ReloadPolicies")
}
var r0 *api.ReloadPoliciesResultMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.ReloadPoliciesParams) (*api.ReloadPoliciesResultMessage, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.ReloadPoliciesParams) *api.ReloadPoliciesResultMessage); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.ReloadPoliciesResultMessage)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.ReloadPoliciesParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RunSelfTest provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) RunSelfTest(_a0 context.Context, _a1 *api.RunSelfTestParams) (*api.SecuritySelfTestResultMessage, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for RunSelfTest")
}
var r0 *api.SecuritySelfTestResultMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.RunSelfTestParams) (*api.SecuritySelfTestResultMessage, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.RunSelfTestParams) *api.SecuritySelfTestResultMessage); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.SecuritySelfTestResultMessage)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.RunSelfTestParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SaveSecurityProfile provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) SaveSecurityProfile(_a0 context.Context, _a1 *api.SecurityProfileSaveParams) (*api.SecurityProfileSaveMessage, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for SaveSecurityProfile")
}
var r0 *api.SecurityProfileSaveMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.SecurityProfileSaveParams) (*api.SecurityProfileSaveMessage, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.SecurityProfileSaveParams) *api.SecurityProfileSaveMessage); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.SecurityProfileSaveMessage)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.SecurityProfileSaveParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// StopActivityDump provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) StopActivityDump(_a0 context.Context, _a1 *api.ActivityDumpStopParams) (*api.ActivityDumpStopMessage, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for StopActivityDump")
}
var r0 *api.ActivityDumpStopMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.ActivityDumpStopParams) (*api.ActivityDumpStopMessage, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.ActivityDumpStopParams) *api.ActivityDumpStopMessage); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.ActivityDumpStopMessage)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.ActivityDumpStopParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// TranscodingRequest provides a mock function with given fields: _a0, _a1
func (_m *SecurityModuleServer) TranscodingRequest(_a0 context.Context, _a1 *api.TranscodingRequestParams) (*api.TranscodingRequestMessage, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for TranscodingRequest")
}
var r0 *api.TranscodingRequestMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *api.TranscodingRequestParams) (*api.TranscodingRequestMessage, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *api.TranscodingRequestParams) *api.TranscodingRequestMessage); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.TranscodingRequestMessage)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *api.TranscodingRequestParams) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mustEmbedUnimplementedSecurityModuleServer provides a mock function with given fields:
func (_m *SecurityModuleServer) mustEmbedUnimplementedSecurityModuleServer() {
_m.Called()
}
// NewSecurityModuleServer creates a new instance of SecurityModuleServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewSecurityModuleServer(t interface {
mock.TestingT
Cleanup(func())
}) *SecurityModuleServer {
mock := &SecurityModuleServer{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}