-
Notifications
You must be signed in to change notification settings - Fork 51
/
mockrpcwrapper.go
210 lines (181 loc) · 6.83 KB
/
mockrpcwrapper.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
// Code generated by MockGen. DO NOT EDIT.
// Source: controller/internal/enforcer/utils/rpcwrapper/interfaces.go
// Package mockrpcwrapper is a generated GoMock package.
package mockrpcwrapper
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
rpcwrapper "go.aporeto.io/trireme-lib/controller/internal/enforcer/utils/rpcwrapper"
)
// MockRPCClient is a mock of RPCClient interface
// nolint
type MockRPCClient struct {
ctrl *gomock.Controller
recorder *MockRPCClientMockRecorder
}
// MockRPCClientMockRecorder is the mock recorder for MockRPCClient
// nolint
type MockRPCClientMockRecorder struct {
mock *MockRPCClient
}
// NewMockRPCClient creates a new mock instance
// nolint
func NewMockRPCClient(ctrl *gomock.Controller) *MockRPCClient {
mock := &MockRPCClient{ctrl: ctrl}
mock.recorder = &MockRPCClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
// nolint
func (m *MockRPCClient) EXPECT() *MockRPCClientMockRecorder {
return m.recorder
}
// NewRPCClient mocks base method
// nolint
func (m *MockRPCClient) NewRPCClient(contextID, channel, rpcSecret string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "NewRPCClient", contextID, channel, rpcSecret)
ret0, _ := ret[0].(error)
return ret0
}
// NewRPCClient indicates an expected call of NewRPCClient
// nolint
func (mr *MockRPCClientMockRecorder) NewRPCClient(contextID, channel, rpcSecret interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewRPCClient", reflect.TypeOf((*MockRPCClient)(nil).NewRPCClient), contextID, channel, rpcSecret)
}
// GetRPCClient mocks base method
// nolint
func (m *MockRPCClient) GetRPCClient(contextID string) (*rpcwrapper.RPCHdl, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetRPCClient", contextID)
ret0, _ := ret[0].(*rpcwrapper.RPCHdl)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetRPCClient indicates an expected call of GetRPCClient
// nolint
func (mr *MockRPCClientMockRecorder) GetRPCClient(contextID interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRPCClient", reflect.TypeOf((*MockRPCClient)(nil).GetRPCClient), contextID)
}
// RemoteCall mocks base method
// nolint
func (m *MockRPCClient) RemoteCall(contextID, methodName string, req *rpcwrapper.Request, resp *rpcwrapper.Response) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RemoteCall", contextID, methodName, req, resp)
ret0, _ := ret[0].(error)
return ret0
}
// RemoteCall indicates an expected call of RemoteCall
// nolint
func (mr *MockRPCClientMockRecorder) RemoteCall(contextID, methodName, req, resp interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoteCall", reflect.TypeOf((*MockRPCClient)(nil).RemoteCall), contextID, methodName, req, resp)
}
// DestroyRPCClient mocks base method
// nolint
func (m *MockRPCClient) DestroyRPCClient(contextID string) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "DestroyRPCClient", contextID)
}
// DestroyRPCClient indicates an expected call of DestroyRPCClient
// nolint
func (mr *MockRPCClientMockRecorder) DestroyRPCClient(contextID interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestroyRPCClient", reflect.TypeOf((*MockRPCClient)(nil).DestroyRPCClient), contextID)
}
// ContextList mocks base method
// nolint
func (m *MockRPCClient) ContextList() []string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ContextList")
ret0, _ := ret[0].([]string)
return ret0
}
// ContextList indicates an expected call of ContextList
// nolint
func (mr *MockRPCClientMockRecorder) ContextList() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContextList", reflect.TypeOf((*MockRPCClient)(nil).ContextList))
}
// CheckValidity mocks base method
// nolint
func (m *MockRPCClient) CheckValidity(req *rpcwrapper.Request, secret string) bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CheckValidity", req, secret)
ret0, _ := ret[0].(bool)
return ret0
}
// CheckValidity indicates an expected call of CheckValidity
// nolint
func (mr *MockRPCClientMockRecorder) CheckValidity(req, secret interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckValidity", reflect.TypeOf((*MockRPCClient)(nil).CheckValidity), req, secret)
}
// MockRPCServer is a mock of RPCServer interface
// nolint
type MockRPCServer struct {
ctrl *gomock.Controller
recorder *MockRPCServerMockRecorder
}
// MockRPCServerMockRecorder is the mock recorder for MockRPCServer
// nolint
type MockRPCServerMockRecorder struct {
mock *MockRPCServer
}
// NewMockRPCServer creates a new mock instance
// nolint
func NewMockRPCServer(ctrl *gomock.Controller) *MockRPCServer {
mock := &MockRPCServer{ctrl: ctrl}
mock.recorder = &MockRPCServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
// nolint
func (m *MockRPCServer) EXPECT() *MockRPCServerMockRecorder {
return m.recorder
}
// StartServer mocks base method
// nolint
func (m *MockRPCServer) StartServer(ctx context.Context, protocol, path string, handler interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StartServer", ctx, protocol, path, handler)
ret0, _ := ret[0].(error)
return ret0
}
// StartServer indicates an expected call of StartServer
// nolint
func (mr *MockRPCServerMockRecorder) StartServer(ctx, protocol, path, handler interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartServer", reflect.TypeOf((*MockRPCServer)(nil).StartServer), ctx, protocol, path, handler)
}
// ProcessMessage mocks base method
// nolint
func (m *MockRPCServer) ProcessMessage(req *rpcwrapper.Request, secret string) bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ProcessMessage", req, secret)
ret0, _ := ret[0].(bool)
return ret0
}
// ProcessMessage indicates an expected call of ProcessMessage
// nolint
func (mr *MockRPCServerMockRecorder) ProcessMessage(req, secret interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockRPCServer)(nil).ProcessMessage), req, secret)
}
// CheckValidity mocks base method
// nolint
func (m *MockRPCServer) CheckValidity(req *rpcwrapper.Request, secret string) bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CheckValidity", req, secret)
ret0, _ := ret[0].(bool)
return ret0
}
// CheckValidity indicates an expected call of CheckValidity
// nolint
func (mr *MockRPCServerMockRecorder) CheckValidity(req, secret interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckValidity", reflect.TypeOf((*MockRPCServer)(nil).CheckValidity), req, secret)
}