-
Notifications
You must be signed in to change notification settings - Fork 103
/
list.go
246 lines (211 loc) · 7.76 KB
/
list.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
// Code generated by MockGen. DO NOT EDIT.
// Source: go.uber.org/yarpc/api/peer (interfaces: Chooser,List,ChooserList)
// Copyright (c) 2021 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// Package peertest is a generated GoMock package.
package peertest
import (
context "context"
gomock "github.com/golang/mock/gomock"
peer "go.uber.org/yarpc/api/peer"
transport "go.uber.org/yarpc/api/transport"
reflect "reflect"
)
// MockChooser is a mock of Chooser interface
type MockChooser struct {
ctrl *gomock.Controller
recorder *MockChooserMockRecorder
}
// MockChooserMockRecorder is the mock recorder for MockChooser
type MockChooserMockRecorder struct {
mock *MockChooser
}
// NewMockChooser creates a new mock instance
func NewMockChooser(ctrl *gomock.Controller) *MockChooser {
mock := &MockChooser{ctrl: ctrl}
mock.recorder = &MockChooserMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockChooser) EXPECT() *MockChooserMockRecorder {
return m.recorder
}
// Choose mocks base method
func (m *MockChooser) Choose(arg0 context.Context, arg1 *transport.Request) (peer.Peer, func(error), error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Choose", arg0, arg1)
ret0, _ := ret[0].(peer.Peer)
ret1, _ := ret[1].(func(error))
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
}
// Choose indicates an expected call of Choose
func (mr *MockChooserMockRecorder) Choose(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Choose", reflect.TypeOf((*MockChooser)(nil).Choose), arg0, arg1)
}
// IsRunning mocks base method
func (m *MockChooser) IsRunning() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsRunning")
ret0, _ := ret[0].(bool)
return ret0
}
// IsRunning indicates an expected call of IsRunning
func (mr *MockChooserMockRecorder) IsRunning() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsRunning", reflect.TypeOf((*MockChooser)(nil).IsRunning))
}
// Start mocks base method
func (m *MockChooser) Start() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Start")
ret0, _ := ret[0].(error)
return ret0
}
// Start indicates an expected call of Start
func (mr *MockChooserMockRecorder) Start() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockChooser)(nil).Start))
}
// Stop mocks base method
func (m *MockChooser) Stop() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Stop")
ret0, _ := ret[0].(error)
return ret0
}
// Stop indicates an expected call of Stop
func (mr *MockChooserMockRecorder) Stop() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockChooser)(nil).Stop))
}
// MockList is a mock of List interface
type MockList struct {
ctrl *gomock.Controller
recorder *MockListMockRecorder
}
// MockListMockRecorder is the mock recorder for MockList
type MockListMockRecorder struct {
mock *MockList
}
// NewMockList creates a new mock instance
func NewMockList(ctrl *gomock.Controller) *MockList {
mock := &MockList{ctrl: ctrl}
mock.recorder = &MockListMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockList) EXPECT() *MockListMockRecorder {
return m.recorder
}
// Update mocks base method
func (m *MockList) Update(arg0 peer.ListUpdates) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Update", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Update indicates an expected call of Update
func (mr *MockListMockRecorder) Update(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockList)(nil).Update), arg0)
}
// MockChooserList is a mock of ChooserList interface
type MockChooserList struct {
ctrl *gomock.Controller
recorder *MockChooserListMockRecorder
}
// MockChooserListMockRecorder is the mock recorder for MockChooserList
type MockChooserListMockRecorder struct {
mock *MockChooserList
}
// NewMockChooserList creates a new mock instance
func NewMockChooserList(ctrl *gomock.Controller) *MockChooserList {
mock := &MockChooserList{ctrl: ctrl}
mock.recorder = &MockChooserListMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockChooserList) EXPECT() *MockChooserListMockRecorder {
return m.recorder
}
// Choose mocks base method
func (m *MockChooserList) Choose(arg0 context.Context, arg1 *transport.Request) (peer.Peer, func(error), error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Choose", arg0, arg1)
ret0, _ := ret[0].(peer.Peer)
ret1, _ := ret[1].(func(error))
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
}
// Choose indicates an expected call of Choose
func (mr *MockChooserListMockRecorder) Choose(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Choose", reflect.TypeOf((*MockChooserList)(nil).Choose), arg0, arg1)
}
// IsRunning mocks base method
func (m *MockChooserList) IsRunning() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsRunning")
ret0, _ := ret[0].(bool)
return ret0
}
// IsRunning indicates an expected call of IsRunning
func (mr *MockChooserListMockRecorder) IsRunning() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsRunning", reflect.TypeOf((*MockChooserList)(nil).IsRunning))
}
// Start mocks base method
func (m *MockChooserList) Start() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Start")
ret0, _ := ret[0].(error)
return ret0
}
// Start indicates an expected call of Start
func (mr *MockChooserListMockRecorder) Start() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockChooserList)(nil).Start))
}
// Stop mocks base method
func (m *MockChooserList) Stop() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Stop")
ret0, _ := ret[0].(error)
return ret0
}
// Stop indicates an expected call of Stop
func (mr *MockChooserListMockRecorder) Stop() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockChooserList)(nil).Stop))
}
// Update mocks base method
func (m *MockChooserList) Update(arg0 peer.ListUpdates) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Update", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Update indicates an expected call of Update
func (mr *MockChooserListMockRecorder) Update(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockChooserList)(nil).Update), arg0)
}