forked from cloudfoundry/gorouter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_registry_interface.go
286 lines (255 loc) · 8.33 KB
/
fake_registry_interface.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
// This file was generated by counterfeiter
package fakes
import (
"sync"
"code.cloudfoundry.org/gorouter/registry"
"code.cloudfoundry.org/gorouter/route"
)
type FakeRegistryInterface struct {
RegisterStub func(uri route.Uri, endpoint *route.Endpoint)
registerMutex sync.RWMutex
registerArgsForCall []struct {
uri route.Uri
endpoint *route.Endpoint
}
UnregisterStub func(uri route.Uri, endpoint *route.Endpoint)
unregisterMutex sync.RWMutex
unregisterArgsForCall []struct {
uri route.Uri
endpoint *route.Endpoint
}
LookupStub func(uri route.Uri) *route.Pool
lookupMutex sync.RWMutex
lookupArgsForCall []struct {
uri route.Uri
}
lookupReturns struct {
result1 *route.Pool
}
LookupWithInstanceStub func(uri route.Uri, appId, appIndex string) *route.Pool
lookupWithInstanceMutex sync.RWMutex
lookupWithInstanceArgsForCall []struct {
uri route.Uri
appId string
appIndex string
}
lookupWithInstanceReturns struct {
result1 *route.Pool
}
StartPruningCycleStub func()
startPruningCycleMutex sync.RWMutex
startPruningCycleArgsForCall []struct{}
StopPruningCycleStub func()
stopPruningCycleMutex sync.RWMutex
stopPruningCycleArgsForCall []struct{}
NumUrisStub func() int
numUrisMutex sync.RWMutex
numUrisArgsForCall []struct{}
numUrisReturns struct {
result1 int
}
NumEndpointsStub func() int
numEndpointsMutex sync.RWMutex
numEndpointsArgsForCall []struct{}
numEndpointsReturns struct {
result1 int
}
MarshalJSONStub func() ([]byte, error)
marshalJSONMutex sync.RWMutex
marshalJSONArgsForCall []struct{}
marshalJSONReturns struct {
result1 []byte
result2 error
}
}
func (fake *FakeRegistryInterface) Register(uri route.Uri, endpoint *route.Endpoint) {
fake.registerMutex.Lock()
fake.registerArgsForCall = append(fake.registerArgsForCall, struct {
uri route.Uri
endpoint *route.Endpoint
}{uri, endpoint})
fake.registerMutex.Unlock()
if fake.RegisterStub != nil {
fake.RegisterStub(uri, endpoint)
}
}
func (fake *FakeRegistryInterface) RegisterCallCount() int {
fake.registerMutex.RLock()
defer fake.registerMutex.RUnlock()
return len(fake.registerArgsForCall)
}
func (fake *FakeRegistryInterface) RegisterArgsForCall(i int) (route.Uri, *route.Endpoint) {
fake.registerMutex.RLock()
defer fake.registerMutex.RUnlock()
return fake.registerArgsForCall[i].uri, fake.registerArgsForCall[i].endpoint
}
func (fake *FakeRegistryInterface) Unregister(uri route.Uri, endpoint *route.Endpoint) {
fake.unregisterMutex.Lock()
fake.unregisterArgsForCall = append(fake.unregisterArgsForCall, struct {
uri route.Uri
endpoint *route.Endpoint
}{uri, endpoint})
fake.unregisterMutex.Unlock()
if fake.UnregisterStub != nil {
fake.UnregisterStub(uri, endpoint)
}
}
func (fake *FakeRegistryInterface) UnregisterCallCount() int {
fake.unregisterMutex.RLock()
defer fake.unregisterMutex.RUnlock()
return len(fake.unregisterArgsForCall)
}
func (fake *FakeRegistryInterface) UnregisterArgsForCall(i int) (route.Uri, *route.Endpoint) {
fake.unregisterMutex.RLock()
defer fake.unregisterMutex.RUnlock()
return fake.unregisterArgsForCall[i].uri, fake.unregisterArgsForCall[i].endpoint
}
func (fake *FakeRegistryInterface) Lookup(uri route.Uri) *route.Pool {
fake.lookupMutex.Lock()
fake.lookupArgsForCall = append(fake.lookupArgsForCall, struct {
uri route.Uri
}{uri})
fake.lookupMutex.Unlock()
if fake.LookupStub != nil {
return fake.LookupStub(uri)
} else {
return fake.lookupReturns.result1
}
}
func (fake *FakeRegistryInterface) LookupCallCount() int {
fake.lookupMutex.RLock()
defer fake.lookupMutex.RUnlock()
return len(fake.lookupArgsForCall)
}
func (fake *FakeRegistryInterface) LookupArgsForCall(i int) route.Uri {
fake.lookupMutex.RLock()
defer fake.lookupMutex.RUnlock()
return fake.lookupArgsForCall[i].uri
}
func (fake *FakeRegistryInterface) LookupReturns(result1 *route.Pool) {
fake.LookupStub = nil
fake.lookupReturns = struct {
result1 *route.Pool
}{result1}
}
func (fake *FakeRegistryInterface) LookupWithInstance(uri route.Uri, appId string, appIndex string) *route.Pool {
fake.lookupWithInstanceMutex.Lock()
fake.lookupWithInstanceArgsForCall = append(fake.lookupWithInstanceArgsForCall, struct {
uri route.Uri
appId string
appIndex string
}{uri, appId, appIndex})
fake.lookupWithInstanceMutex.Unlock()
if fake.LookupWithInstanceStub != nil {
return fake.LookupWithInstanceStub(uri, appId, appIndex)
} else {
return fake.lookupWithInstanceReturns.result1
}
}
func (fake *FakeRegistryInterface) LookupWithInstanceCallCount() int {
fake.lookupWithInstanceMutex.RLock()
defer fake.lookupWithInstanceMutex.RUnlock()
return len(fake.lookupWithInstanceArgsForCall)
}
func (fake *FakeRegistryInterface) LookupWithInstanceArgsForCall(i int) (route.Uri, string, string) {
fake.lookupWithInstanceMutex.RLock()
defer fake.lookupWithInstanceMutex.RUnlock()
return fake.lookupWithInstanceArgsForCall[i].uri, fake.lookupWithInstanceArgsForCall[i].appId, fake.lookupWithInstanceArgsForCall[i].appIndex
}
func (fake *FakeRegistryInterface) LookupWithInstanceReturns(result1 *route.Pool) {
fake.LookupWithInstanceStub = nil
fake.lookupWithInstanceReturns = struct {
result1 *route.Pool
}{result1}
}
func (fake *FakeRegistryInterface) StartPruningCycle() {
fake.startPruningCycleMutex.Lock()
fake.startPruningCycleArgsForCall = append(fake.startPruningCycleArgsForCall, struct{}{})
fake.startPruningCycleMutex.Unlock()
if fake.StartPruningCycleStub != nil {
fake.StartPruningCycleStub()
}
}
func (fake *FakeRegistryInterface) StartPruningCycleCallCount() int {
fake.startPruningCycleMutex.RLock()
defer fake.startPruningCycleMutex.RUnlock()
return len(fake.startPruningCycleArgsForCall)
}
func (fake *FakeRegistryInterface) StopPruningCycle() {
fake.stopPruningCycleMutex.Lock()
fake.stopPruningCycleArgsForCall = append(fake.stopPruningCycleArgsForCall, struct{}{})
fake.stopPruningCycleMutex.Unlock()
if fake.StopPruningCycleStub != nil {
fake.StopPruningCycleStub()
}
}
func (fake *FakeRegistryInterface) StopPruningCycleCallCount() int {
fake.stopPruningCycleMutex.RLock()
defer fake.stopPruningCycleMutex.RUnlock()
return len(fake.stopPruningCycleArgsForCall)
}
func (fake *FakeRegistryInterface) NumUris() int {
fake.numUrisMutex.Lock()
fake.numUrisArgsForCall = append(fake.numUrisArgsForCall, struct{}{})
fake.numUrisMutex.Unlock()
if fake.NumUrisStub != nil {
return fake.NumUrisStub()
} else {
return fake.numUrisReturns.result1
}
}
func (fake *FakeRegistryInterface) NumUrisCallCount() int {
fake.numUrisMutex.RLock()
defer fake.numUrisMutex.RUnlock()
return len(fake.numUrisArgsForCall)
}
func (fake *FakeRegistryInterface) NumUrisReturns(result1 int) {
fake.NumUrisStub = nil
fake.numUrisReturns = struct {
result1 int
}{result1}
}
func (fake *FakeRegistryInterface) NumEndpoints() int {
fake.numEndpointsMutex.Lock()
fake.numEndpointsArgsForCall = append(fake.numEndpointsArgsForCall, struct{}{})
fake.numEndpointsMutex.Unlock()
if fake.NumEndpointsStub != nil {
return fake.NumEndpointsStub()
} else {
return fake.numEndpointsReturns.result1
}
}
func (fake *FakeRegistryInterface) NumEndpointsCallCount() int {
fake.numEndpointsMutex.RLock()
defer fake.numEndpointsMutex.RUnlock()
return len(fake.numEndpointsArgsForCall)
}
func (fake *FakeRegistryInterface) NumEndpointsReturns(result1 int) {
fake.NumEndpointsStub = nil
fake.numEndpointsReturns = struct {
result1 int
}{result1}
}
func (fake *FakeRegistryInterface) MarshalJSON() ([]byte, error) {
fake.marshalJSONMutex.Lock()
fake.marshalJSONArgsForCall = append(fake.marshalJSONArgsForCall, struct{}{})
fake.marshalJSONMutex.Unlock()
if fake.MarshalJSONStub != nil {
return fake.MarshalJSONStub()
} else {
return fake.marshalJSONReturns.result1, fake.marshalJSONReturns.result2
}
}
func (fake *FakeRegistryInterface) MarshalJSONCallCount() int {
fake.marshalJSONMutex.RLock()
defer fake.marshalJSONMutex.RUnlock()
return len(fake.marshalJSONArgsForCall)
}
func (fake *FakeRegistryInterface) MarshalJSONReturns(result1 []byte, result2 error) {
fake.MarshalJSONStub = nil
fake.marshalJSONReturns = struct {
result1 []byte
result2 error
}{result1, result2}
}
var _ registry.RegistryInterface = new(FakeRegistryInterface)