-
Notifications
You must be signed in to change notification settings - Fork 51
/
mockenforcer.go
241 lines (206 loc) · 8.5 KB
/
mockenforcer.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
// Code generated by MockGen. DO NOT EDIT.
// Source: controller/internal/enforcer/enforcer.go
// Package mockenforcer is a generated GoMock package.
package mockenforcer
import (
context "context"
reflect "reflect"
time "time"
gomock "github.com/golang/mock/gomock"
constants "go.aporeto.io/trireme-lib/controller/constants"
fqconfig "go.aporeto.io/trireme-lib/controller/pkg/fqconfig"
packettracing "go.aporeto.io/trireme-lib/controller/pkg/packettracing"
secrets "go.aporeto.io/trireme-lib/controller/pkg/secrets"
runtime "go.aporeto.io/trireme-lib/controller/runtime"
policy "go.aporeto.io/trireme-lib/policy"
)
// MockEnforcer is a mock of Enforcer interface
// nolint
type MockEnforcer struct {
ctrl *gomock.Controller
recorder *MockEnforcerMockRecorder
}
// MockEnforcerMockRecorder is the mock recorder for MockEnforcer
// nolint
type MockEnforcerMockRecorder struct {
mock *MockEnforcer
}
// NewMockEnforcer creates a new mock instance
// nolint
func NewMockEnforcer(ctrl *gomock.Controller) *MockEnforcer {
mock := &MockEnforcer{ctrl: ctrl}
mock.recorder = &MockEnforcerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
// nolint
func (m *MockEnforcer) EXPECT() *MockEnforcerMockRecorder {
return m.recorder
}
// Enforce mocks base method
// nolint
func (m *MockEnforcer) Enforce(contextID string, puInfo *policy.PUInfo) error {
ret := m.ctrl.Call(m, "Enforce", contextID, puInfo)
ret0, _ := ret[0].(error)
return ret0
}
// Enforce indicates an expected call of Enforce
// nolint
func (mr *MockEnforcerMockRecorder) Enforce(contextID, puInfo interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enforce", reflect.TypeOf((*MockEnforcer)(nil).Enforce), contextID, puInfo)
}
// Unenforce mocks base method
// nolint
func (m *MockEnforcer) Unenforce(contextID string) error {
ret := m.ctrl.Call(m, "Unenforce", contextID)
ret0, _ := ret[0].(error)
return ret0
}
// Unenforce indicates an expected call of Unenforce
// nolint
func (mr *MockEnforcerMockRecorder) Unenforce(contextID interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unenforce", reflect.TypeOf((*MockEnforcer)(nil).Unenforce), contextID)
}
// GetFilterQueue mocks base method
// nolint
func (m *MockEnforcer) GetFilterQueue() *fqconfig.FilterQueue {
ret := m.ctrl.Call(m, "GetFilterQueue")
ret0, _ := ret[0].(*fqconfig.FilterQueue)
return ret0
}
// GetFilterQueue indicates an expected call of GetFilterQueue
// nolint
func (mr *MockEnforcerMockRecorder) GetFilterQueue() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFilterQueue", reflect.TypeOf((*MockEnforcer)(nil).GetFilterQueue))
}
// Run mocks base method
// nolint
func (m *MockEnforcer) Run(ctx context.Context) error {
ret := m.ctrl.Call(m, "Run", ctx)
ret0, _ := ret[0].(error)
return ret0
}
// Run indicates an expected call of Run
// nolint
func (mr *MockEnforcerMockRecorder) Run(ctx interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockEnforcer)(nil).Run), ctx)
}
// UpdateSecrets mocks base method
// nolint
func (m *MockEnforcer) UpdateSecrets(secrets secrets.Secrets) error {
ret := m.ctrl.Call(m, "UpdateSecrets", secrets)
ret0, _ := ret[0].(error)
return ret0
}
// UpdateSecrets indicates an expected call of UpdateSecrets
// nolint
func (mr *MockEnforcerMockRecorder) UpdateSecrets(secrets interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSecrets", reflect.TypeOf((*MockEnforcer)(nil).UpdateSecrets), secrets)
}
// SetTargetNetworks mocks base method
// nolint
func (m *MockEnforcer) SetTargetNetworks(cfg *runtime.Configuration) error {
ret := m.ctrl.Call(m, "SetTargetNetworks", cfg)
ret0, _ := ret[0].(error)
return ret0
}
// SetTargetNetworks indicates an expected call of SetTargetNetworks
// nolint
func (mr *MockEnforcerMockRecorder) SetTargetNetworks(cfg interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTargetNetworks", reflect.TypeOf((*MockEnforcer)(nil).SetTargetNetworks), cfg)
}
// SetLogLevel mocks base method
// nolint
func (m *MockEnforcer) SetLogLevel(level constants.LogLevel) error {
ret := m.ctrl.Call(m, "SetLogLevel", level)
ret0, _ := ret[0].(error)
return ret0
}
// SetLogLevel indicates an expected call of SetLogLevel
// nolint
func (mr *MockEnforcerMockRecorder) SetLogLevel(level interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLogLevel", reflect.TypeOf((*MockEnforcer)(nil).SetLogLevel), level)
}
// CleanUp mocks base method
// nolint
func (m *MockEnforcer) CleanUp() error {
ret := m.ctrl.Call(m, "CleanUp")
ret0, _ := ret[0].(error)
return ret0
}
// CleanUp indicates an expected call of CleanUp
// nolint
func (mr *MockEnforcerMockRecorder) CleanUp() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CleanUp", reflect.TypeOf((*MockEnforcer)(nil).CleanUp))
}
// EnableDatapathPacketTracing mocks base method
// nolint
func (m *MockEnforcer) EnableDatapathPacketTracing(ctx context.Context, contextID string, direction packettracing.TracingDirection, interval time.Duration) error {
ret := m.ctrl.Call(m, "EnableDatapathPacketTracing", ctx, contextID, direction, interval)
ret0, _ := ret[0].(error)
return ret0
}
// EnableDatapathPacketTracing indicates an expected call of EnableDatapathPacketTracing
// nolint
func (mr *MockEnforcerMockRecorder) EnableDatapathPacketTracing(ctx, contextID, direction, interval interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnableDatapathPacketTracing", reflect.TypeOf((*MockEnforcer)(nil).EnableDatapathPacketTracing), ctx, contextID, direction, interval)
}
// EnableIPTablesPacketTracing mocks base method
// nolint
func (m *MockEnforcer) EnableIPTablesPacketTracing(ctx context.Context, contextID string, interval time.Duration) error {
ret := m.ctrl.Call(m, "EnableIPTablesPacketTracing", ctx, contextID, interval)
ret0, _ := ret[0].(error)
return ret0
}
// EnableIPTablesPacketTracing indicates an expected call of EnableIPTablesPacketTracing
// nolint
func (mr *MockEnforcerMockRecorder) EnableIPTablesPacketTracing(ctx, contextID, interval interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnableIPTablesPacketTracing", reflect.TypeOf((*MockEnforcer)(nil).EnableIPTablesPacketTracing), ctx, contextID, interval)
}
// MockDebugInfo is a mock of DebugInfo interface
// nolint
type MockDebugInfo struct {
ctrl *gomock.Controller
recorder *MockDebugInfoMockRecorder
}
// MockDebugInfoMockRecorder is the mock recorder for MockDebugInfo
// nolint
type MockDebugInfoMockRecorder struct {
mock *MockDebugInfo
}
// NewMockDebugInfo creates a new mock instance
// nolint
func NewMockDebugInfo(ctrl *gomock.Controller) *MockDebugInfo {
mock := &MockDebugInfo{ctrl: ctrl}
mock.recorder = &MockDebugInfoMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
// nolint
func (m *MockDebugInfo) EXPECT() *MockDebugInfoMockRecorder {
return m.recorder
}
// EnableDatapathPacketTracing mocks base method
// nolint
func (m *MockDebugInfo) EnableDatapathPacketTracing(ctx context.Context, contextID string, direction packettracing.TracingDirection, interval time.Duration) error {
ret := m.ctrl.Call(m, "EnableDatapathPacketTracing", ctx, contextID, direction, interval)
ret0, _ := ret[0].(error)
return ret0
}
// EnableDatapathPacketTracing indicates an expected call of EnableDatapathPacketTracing
// nolint
func (mr *MockDebugInfoMockRecorder) EnableDatapathPacketTracing(ctx, contextID, direction, interval interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnableDatapathPacketTracing", reflect.TypeOf((*MockDebugInfo)(nil).EnableDatapathPacketTracing), ctx, contextID, direction, interval)
}
// EnableIPTablesPacketTracing mocks base method
// nolint
func (m *MockDebugInfo) EnableIPTablesPacketTracing(ctx context.Context, contextID string, interval time.Duration) error {
ret := m.ctrl.Call(m, "EnableIPTablesPacketTracing", ctx, contextID, interval)
ret0, _ := ret[0].(error)
return ret0
}
// EnableIPTablesPacketTracing indicates an expected call of EnableIPTablesPacketTracing
// nolint
func (mr *MockDebugInfoMockRecorder) EnableIPTablesPacketTracing(ctx, contextID, interval interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnableIPTablesPacketTracing", reflect.TypeOf((*MockDebugInfo)(nil).EnableIPTablesPacketTracing), ctx, contextID, interval)
}