-
Notifications
You must be signed in to change notification settings - Fork 53
/
plugin.go
228 lines (191 loc) · 8.78 KB
/
plugin.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
// Code generated by MockGen. DO NOT EDIT.
// Source: pkg/plugins/apis/apiextensions/stream/plugin.go
// Package mock_stream is a generated GoMock package.
package mock_stream
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
v1 "github.com/rancher/opni/pkg/apis/stream/v1"
apiextensions "github.com/rancher/opni/pkg/plugins/apis/apiextensions"
stream "github.com/rancher/opni/pkg/plugins/apis/apiextensions/stream"
grpc "google.golang.org/grpc"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// MockStreamAPIExtension is a mock of StreamAPIExtension interface.
type MockStreamAPIExtension struct {
ctrl *gomock.Controller
recorder *MockStreamAPIExtensionMockRecorder
}
// MockStreamAPIExtensionMockRecorder is the mock recorder for MockStreamAPIExtension.
type MockStreamAPIExtensionMockRecorder struct {
mock *MockStreamAPIExtension
}
// NewMockStreamAPIExtension creates a new mock instance.
func NewMockStreamAPIExtension(ctrl *gomock.Controller) *MockStreamAPIExtension {
mock := &MockStreamAPIExtension{ctrl: ctrl}
mock.recorder = &MockStreamAPIExtensionMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockStreamAPIExtension) EXPECT() *MockStreamAPIExtensionMockRecorder {
return m.recorder
}
// StreamServers mocks base method.
func (m *MockStreamAPIExtension) StreamServers() []stream.Server {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StreamServers")
ret0, _ := ret[0].([]stream.Server)
return ret0
}
// StreamServers indicates an expected call of StreamServers.
func (mr *MockStreamAPIExtensionMockRecorder) StreamServers() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamServers", reflect.TypeOf((*MockStreamAPIExtension)(nil).StreamServers))
}
// MockStreamClientHandler is a mock of StreamClientHandler interface.
type MockStreamClientHandler struct {
ctrl *gomock.Controller
recorder *MockStreamClientHandlerMockRecorder
}
// MockStreamClientHandlerMockRecorder is the mock recorder for MockStreamClientHandler.
type MockStreamClientHandlerMockRecorder struct {
mock *MockStreamClientHandler
}
// NewMockStreamClientHandler creates a new mock instance.
func NewMockStreamClientHandler(ctrl *gomock.Controller) *MockStreamClientHandler {
mock := &MockStreamClientHandler{ctrl: ctrl}
mock.recorder = &MockStreamClientHandlerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockStreamClientHandler) EXPECT() *MockStreamClientHandlerMockRecorder {
return m.recorder
}
// UseStreamClient mocks base method.
func (m *MockStreamClientHandler) UseStreamClient(client grpc.ClientConnInterface) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "UseStreamClient", client)
}
// UseStreamClient indicates an expected call of UseStreamClient.
func (mr *MockStreamClientHandlerMockRecorder) UseStreamClient(client interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseStreamClient", reflect.TypeOf((*MockStreamClientHandler)(nil).UseStreamClient), client)
}
// MockStreamAPIExtensionWithHandlers is a mock of StreamAPIExtensionWithHandlers interface.
type MockStreamAPIExtensionWithHandlers struct {
ctrl *gomock.Controller
recorder *MockStreamAPIExtensionWithHandlersMockRecorder
}
// MockStreamAPIExtensionWithHandlersMockRecorder is the mock recorder for MockStreamAPIExtensionWithHandlers.
type MockStreamAPIExtensionWithHandlersMockRecorder struct {
mock *MockStreamAPIExtensionWithHandlers
}
// NewMockStreamAPIExtensionWithHandlers creates a new mock instance.
func NewMockStreamAPIExtensionWithHandlers(ctrl *gomock.Controller) *MockStreamAPIExtensionWithHandlers {
mock := &MockStreamAPIExtensionWithHandlers{ctrl: ctrl}
mock.recorder = &MockStreamAPIExtensionWithHandlersMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockStreamAPIExtensionWithHandlers) EXPECT() *MockStreamAPIExtensionWithHandlersMockRecorder {
return m.recorder
}
// StreamServers mocks base method.
func (m *MockStreamAPIExtensionWithHandlers) StreamServers() []stream.Server {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StreamServers")
ret0, _ := ret[0].([]stream.Server)
return ret0
}
// StreamServers indicates an expected call of StreamServers.
func (mr *MockStreamAPIExtensionWithHandlersMockRecorder) StreamServers() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamServers", reflect.TypeOf((*MockStreamAPIExtensionWithHandlers)(nil).StreamServers))
}
// UseStreamClient mocks base method.
func (m *MockStreamAPIExtensionWithHandlers) UseStreamClient(client grpc.ClientConnInterface) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "UseStreamClient", client)
}
// UseStreamClient indicates an expected call of UseStreamClient.
func (mr *MockStreamAPIExtensionWithHandlersMockRecorder) UseStreamClient(client interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseStreamClient", reflect.TypeOf((*MockStreamAPIExtensionWithHandlers)(nil).UseStreamClient), client)
}
// MockstreamExtPlugin is a mock of streamExtPlugin interface.
type MockstreamExtPlugin struct {
ctrl *gomock.Controller
recorder *MockstreamExtPluginMockRecorder
}
// MockstreamExtPluginMockRecorder is the mock recorder for MockstreamExtPlugin.
type MockstreamExtPluginMockRecorder struct {
mock *MockstreamExtPlugin
}
// NewMockstreamExtPlugin creates a new mock instance.
func NewMockstreamExtPlugin(ctrl *gomock.Controller) *MockstreamExtPlugin {
mock := &MockstreamExtPlugin{ctrl: ctrl}
mock.recorder = &MockstreamExtPluginMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockstreamExtPlugin) EXPECT() *MockstreamExtPluginMockRecorder {
return m.recorder
}
// Connect mocks base method.
func (m *MockstreamExtPlugin) Connect(arg0 v1.Stream_ConnectServer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Connect", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Connect indicates an expected call of Connect.
func (mr *MockstreamExtPluginMockRecorder) Connect(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connect", reflect.TypeOf((*MockstreamExtPlugin)(nil).Connect), arg0)
}
// ConnectInternal mocks base method.
func (m *MockstreamExtPlugin) ConnectInternal(arg0 apiextensions.StreamAPIExtension_ConnectInternalServer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ConnectInternal", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// ConnectInternal indicates an expected call of ConnectInternal.
func (mr *MockstreamExtPluginMockRecorder) ConnectInternal(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnectInternal", reflect.TypeOf((*MockstreamExtPlugin)(nil).ConnectInternal), arg0)
}
// Notify mocks base method.
func (m *MockstreamExtPlugin) Notify(arg0 context.Context, arg1 *v1.StreamEvent) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Notify", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Notify indicates an expected call of Notify.
func (mr *MockstreamExtPluginMockRecorder) Notify(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Notify", reflect.TypeOf((*MockstreamExtPlugin)(nil).Notify), arg0, arg1)
}
// mustEmbedUnimplementedStreamAPIExtensionServer mocks base method.
func (m *MockstreamExtPlugin) mustEmbedUnimplementedStreamAPIExtensionServer() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "mustEmbedUnimplementedStreamAPIExtensionServer")
}
// mustEmbedUnimplementedStreamAPIExtensionServer indicates an expected call of mustEmbedUnimplementedStreamAPIExtensionServer.
func (mr *MockstreamExtPluginMockRecorder) mustEmbedUnimplementedStreamAPIExtensionServer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "mustEmbedUnimplementedStreamAPIExtensionServer", reflect.TypeOf((*MockstreamExtPlugin)(nil).mustEmbedUnimplementedStreamAPIExtensionServer))
}
// mustEmbedUnimplementedStreamServer mocks base method.
func (m *MockstreamExtPlugin) mustEmbedUnimplementedStreamServer() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "mustEmbedUnimplementedStreamServer")
}
// mustEmbedUnimplementedStreamServer indicates an expected call of mustEmbedUnimplementedStreamServer.
func (mr *MockstreamExtPluginMockRecorder) mustEmbedUnimplementedStreamServer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "mustEmbedUnimplementedStreamServer", reflect.TypeOf((*MockstreamExtPlugin)(nil).mustEmbedUnimplementedStreamServer))
}