-
Notifications
You must be signed in to change notification settings - Fork 151
/
user_repositories_client.go
375 lines (345 loc) · 12.1 KB
/
user_repositories_client.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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
// Code generated by counterfeiter. DO NOT EDIT.
package fakegitprovider
import (
"context"
"sync"
"github.com/fluxcd/go-git-providers/gitprovider"
)
type UserRepositoriesClient struct {
CreateStub func(context.Context, gitprovider.UserRepositoryRef, gitprovider.RepositoryInfo, ...gitprovider.RepositoryCreateOption) (gitprovider.UserRepository, error)
createMutex sync.RWMutex
createArgsForCall []struct {
arg1 context.Context
arg2 gitprovider.UserRepositoryRef
arg3 gitprovider.RepositoryInfo
arg4 []gitprovider.RepositoryCreateOption
}
createReturns struct {
result1 gitprovider.UserRepository
result2 error
}
createReturnsOnCall map[int]struct {
result1 gitprovider.UserRepository
result2 error
}
GetStub func(context.Context, gitprovider.UserRepositoryRef) (gitprovider.UserRepository, error)
getMutex sync.RWMutex
getArgsForCall []struct {
arg1 context.Context
arg2 gitprovider.UserRepositoryRef
}
getReturns struct {
result1 gitprovider.UserRepository
result2 error
}
getReturnsOnCall map[int]struct {
result1 gitprovider.UserRepository
result2 error
}
ListStub func(context.Context, gitprovider.UserRef) ([]gitprovider.UserRepository, error)
listMutex sync.RWMutex
listArgsForCall []struct {
arg1 context.Context
arg2 gitprovider.UserRef
}
listReturns struct {
result1 []gitprovider.UserRepository
result2 error
}
listReturnsOnCall map[int]struct {
result1 []gitprovider.UserRepository
result2 error
}
ReconcileStub func(context.Context, gitprovider.UserRepositoryRef, gitprovider.RepositoryInfo, ...gitprovider.RepositoryReconcileOption) (gitprovider.UserRepository, bool, error)
reconcileMutex sync.RWMutex
reconcileArgsForCall []struct {
arg1 context.Context
arg2 gitprovider.UserRepositoryRef
arg3 gitprovider.RepositoryInfo
arg4 []gitprovider.RepositoryReconcileOption
}
reconcileReturns struct {
result1 gitprovider.UserRepository
result2 bool
result3 error
}
reconcileReturnsOnCall map[int]struct {
result1 gitprovider.UserRepository
result2 bool
result3 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *UserRepositoriesClient) Create(arg1 context.Context, arg2 gitprovider.UserRepositoryRef, arg3 gitprovider.RepositoryInfo, arg4 ...gitprovider.RepositoryCreateOption) (gitprovider.UserRepository, error) {
fake.createMutex.Lock()
ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)]
fake.createArgsForCall = append(fake.createArgsForCall, struct {
arg1 context.Context
arg2 gitprovider.UserRepositoryRef
arg3 gitprovider.RepositoryInfo
arg4 []gitprovider.RepositoryCreateOption
}{arg1, arg2, arg3, arg4})
stub := fake.CreateStub
fakeReturns := fake.createReturns
fake.recordInvocation("Create", []interface{}{arg1, arg2, arg3, arg4})
fake.createMutex.Unlock()
if stub != nil {
return stub(arg1, arg2, arg3, arg4...)
}
if specificReturn {
return ret.result1, ret.result2
}
return fakeReturns.result1, fakeReturns.result2
}
func (fake *UserRepositoriesClient) CreateCallCount() int {
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
return len(fake.createArgsForCall)
}
func (fake *UserRepositoriesClient) CreateCalls(stub func(context.Context, gitprovider.UserRepositoryRef, gitprovider.RepositoryInfo, ...gitprovider.RepositoryCreateOption) (gitprovider.UserRepository, error)) {
fake.createMutex.Lock()
defer fake.createMutex.Unlock()
fake.CreateStub = stub
}
func (fake *UserRepositoriesClient) CreateArgsForCall(i int) (context.Context, gitprovider.UserRepositoryRef, gitprovider.RepositoryInfo, []gitprovider.RepositoryCreateOption) {
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
argsForCall := fake.createArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
}
func (fake *UserRepositoriesClient) CreateReturns(result1 gitprovider.UserRepository, result2 error) {
fake.createMutex.Lock()
defer fake.createMutex.Unlock()
fake.CreateStub = nil
fake.createReturns = struct {
result1 gitprovider.UserRepository
result2 error
}{result1, result2}
}
func (fake *UserRepositoriesClient) CreateReturnsOnCall(i int, result1 gitprovider.UserRepository, result2 error) {
fake.createMutex.Lock()
defer fake.createMutex.Unlock()
fake.CreateStub = nil
if fake.createReturnsOnCall == nil {
fake.createReturnsOnCall = make(map[int]struct {
result1 gitprovider.UserRepository
result2 error
})
}
fake.createReturnsOnCall[i] = struct {
result1 gitprovider.UserRepository
result2 error
}{result1, result2}
}
func (fake *UserRepositoriesClient) Get(arg1 context.Context, arg2 gitprovider.UserRepositoryRef) (gitprovider.UserRepository, error) {
fake.getMutex.Lock()
ret, specificReturn := fake.getReturnsOnCall[len(fake.getArgsForCall)]
fake.getArgsForCall = append(fake.getArgsForCall, struct {
arg1 context.Context
arg2 gitprovider.UserRepositoryRef
}{arg1, arg2})
stub := fake.GetStub
fakeReturns := fake.getReturns
fake.recordInvocation("Get", []interface{}{arg1, arg2})
fake.getMutex.Unlock()
if stub != nil {
return stub(arg1, arg2)
}
if specificReturn {
return ret.result1, ret.result2
}
return fakeReturns.result1, fakeReturns.result2
}
func (fake *UserRepositoriesClient) GetCallCount() int {
fake.getMutex.RLock()
defer fake.getMutex.RUnlock()
return len(fake.getArgsForCall)
}
func (fake *UserRepositoriesClient) GetCalls(stub func(context.Context, gitprovider.UserRepositoryRef) (gitprovider.UserRepository, error)) {
fake.getMutex.Lock()
defer fake.getMutex.Unlock()
fake.GetStub = stub
}
func (fake *UserRepositoriesClient) GetArgsForCall(i int) (context.Context, gitprovider.UserRepositoryRef) {
fake.getMutex.RLock()
defer fake.getMutex.RUnlock()
argsForCall := fake.getArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *UserRepositoriesClient) GetReturns(result1 gitprovider.UserRepository, result2 error) {
fake.getMutex.Lock()
defer fake.getMutex.Unlock()
fake.GetStub = nil
fake.getReturns = struct {
result1 gitprovider.UserRepository
result2 error
}{result1, result2}
}
func (fake *UserRepositoriesClient) GetReturnsOnCall(i int, result1 gitprovider.UserRepository, result2 error) {
fake.getMutex.Lock()
defer fake.getMutex.Unlock()
fake.GetStub = nil
if fake.getReturnsOnCall == nil {
fake.getReturnsOnCall = make(map[int]struct {
result1 gitprovider.UserRepository
result2 error
})
}
fake.getReturnsOnCall[i] = struct {
result1 gitprovider.UserRepository
result2 error
}{result1, result2}
}
func (fake *UserRepositoriesClient) List(arg1 context.Context, arg2 gitprovider.UserRef) ([]gitprovider.UserRepository, error) {
fake.listMutex.Lock()
ret, specificReturn := fake.listReturnsOnCall[len(fake.listArgsForCall)]
fake.listArgsForCall = append(fake.listArgsForCall, struct {
arg1 context.Context
arg2 gitprovider.UserRef
}{arg1, arg2})
stub := fake.ListStub
fakeReturns := fake.listReturns
fake.recordInvocation("List", []interface{}{arg1, arg2})
fake.listMutex.Unlock()
if stub != nil {
return stub(arg1, arg2)
}
if specificReturn {
return ret.result1, ret.result2
}
return fakeReturns.result1, fakeReturns.result2
}
func (fake *UserRepositoriesClient) ListCallCount() int {
fake.listMutex.RLock()
defer fake.listMutex.RUnlock()
return len(fake.listArgsForCall)
}
func (fake *UserRepositoriesClient) ListCalls(stub func(context.Context, gitprovider.UserRef) ([]gitprovider.UserRepository, error)) {
fake.listMutex.Lock()
defer fake.listMutex.Unlock()
fake.ListStub = stub
}
func (fake *UserRepositoriesClient) ListArgsForCall(i int) (context.Context, gitprovider.UserRef) {
fake.listMutex.RLock()
defer fake.listMutex.RUnlock()
argsForCall := fake.listArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *UserRepositoriesClient) ListReturns(result1 []gitprovider.UserRepository, result2 error) {
fake.listMutex.Lock()
defer fake.listMutex.Unlock()
fake.ListStub = nil
fake.listReturns = struct {
result1 []gitprovider.UserRepository
result2 error
}{result1, result2}
}
func (fake *UserRepositoriesClient) ListReturnsOnCall(i int, result1 []gitprovider.UserRepository, result2 error) {
fake.listMutex.Lock()
defer fake.listMutex.Unlock()
fake.ListStub = nil
if fake.listReturnsOnCall == nil {
fake.listReturnsOnCall = make(map[int]struct {
result1 []gitprovider.UserRepository
result2 error
})
}
fake.listReturnsOnCall[i] = struct {
result1 []gitprovider.UserRepository
result2 error
}{result1, result2}
}
func (fake *UserRepositoriesClient) Reconcile(arg1 context.Context, arg2 gitprovider.UserRepositoryRef, arg3 gitprovider.RepositoryInfo, arg4 ...gitprovider.RepositoryReconcileOption) (gitprovider.UserRepository, bool, error) {
fake.reconcileMutex.Lock()
ret, specificReturn := fake.reconcileReturnsOnCall[len(fake.reconcileArgsForCall)]
fake.reconcileArgsForCall = append(fake.reconcileArgsForCall, struct {
arg1 context.Context
arg2 gitprovider.UserRepositoryRef
arg3 gitprovider.RepositoryInfo
arg4 []gitprovider.RepositoryReconcileOption
}{arg1, arg2, arg3, arg4})
stub := fake.ReconcileStub
fakeReturns := fake.reconcileReturns
fake.recordInvocation("Reconcile", []interface{}{arg1, arg2, arg3, arg4})
fake.reconcileMutex.Unlock()
if stub != nil {
return stub(arg1, arg2, arg3, arg4...)
}
if specificReturn {
return ret.result1, ret.result2, ret.result3
}
return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
}
func (fake *UserRepositoriesClient) ReconcileCallCount() int {
fake.reconcileMutex.RLock()
defer fake.reconcileMutex.RUnlock()
return len(fake.reconcileArgsForCall)
}
func (fake *UserRepositoriesClient) ReconcileCalls(stub func(context.Context, gitprovider.UserRepositoryRef, gitprovider.RepositoryInfo, ...gitprovider.RepositoryReconcileOption) (gitprovider.UserRepository, bool, error)) {
fake.reconcileMutex.Lock()
defer fake.reconcileMutex.Unlock()
fake.ReconcileStub = stub
}
func (fake *UserRepositoriesClient) ReconcileArgsForCall(i int) (context.Context, gitprovider.UserRepositoryRef, gitprovider.RepositoryInfo, []gitprovider.RepositoryReconcileOption) {
fake.reconcileMutex.RLock()
defer fake.reconcileMutex.RUnlock()
argsForCall := fake.reconcileArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
}
func (fake *UserRepositoriesClient) ReconcileReturns(result1 gitprovider.UserRepository, result2 bool, result3 error) {
fake.reconcileMutex.Lock()
defer fake.reconcileMutex.Unlock()
fake.ReconcileStub = nil
fake.reconcileReturns = struct {
result1 gitprovider.UserRepository
result2 bool
result3 error
}{result1, result2, result3}
}
func (fake *UserRepositoriesClient) ReconcileReturnsOnCall(i int, result1 gitprovider.UserRepository, result2 bool, result3 error) {
fake.reconcileMutex.Lock()
defer fake.reconcileMutex.Unlock()
fake.ReconcileStub = nil
if fake.reconcileReturnsOnCall == nil {
fake.reconcileReturnsOnCall = make(map[int]struct {
result1 gitprovider.UserRepository
result2 bool
result3 error
})
}
fake.reconcileReturnsOnCall[i] = struct {
result1 gitprovider.UserRepository
result2 bool
result3 error
}{result1, result2, result3}
}
func (fake *UserRepositoriesClient) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
fake.getMutex.RLock()
defer fake.getMutex.RUnlock()
fake.listMutex.RLock()
defer fake.listMutex.RUnlock()
fake.reconcileMutex.RLock()
defer fake.reconcileMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *UserRepositoriesClient) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ gitprovider.UserRepositoriesClient = new(UserRepositoriesClient)