-
Notifications
You must be signed in to change notification settings - Fork 90
/
create.go
339 lines (309 loc) · 8.39 KB
/
create.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
// Code generated by counterfeiter. DO NOT EDIT.
package mocks
import (
sql "database/sql"
sync "sync"
sqlite "github.com/kfsoftware/hlf-operator/internal/github.com/hyperledger/fabric-ca/lib/server/db/sqlite"
)
type Create struct {
CommitStub func(string) error
commitMutex sync.RWMutex
commitArgsForCall []struct {
arg1 string
}
commitReturns struct {
result1 error
}
commitReturnsOnCall map[int]struct {
result1 error
}
ExecStub func(string, string, ...interface{}) (sql.Result, error)
execMutex sync.RWMutex
execArgsForCall []struct {
arg1 string
arg2 string
arg3 []interface{}
}
execReturns struct {
result1 sql.Result
result2 error
}
execReturnsOnCall map[int]struct {
result1 sql.Result
result2 error
}
RebindStub func(string) string
rebindMutex sync.RWMutex
rebindArgsForCall []struct {
arg1 string
}
rebindReturns struct {
result1 string
}
rebindReturnsOnCall map[int]struct {
result1 string
}
RollbackStub func(string) error
rollbackMutex sync.RWMutex
rollbackArgsForCall []struct {
arg1 string
}
rollbackReturns struct {
result1 error
}
rollbackReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *Create) Commit(arg1 string) error {
fake.commitMutex.Lock()
ret, specificReturn := fake.commitReturnsOnCall[len(fake.commitArgsForCall)]
fake.commitArgsForCall = append(fake.commitArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("Commit", []interface{}{arg1})
fake.commitMutex.Unlock()
if fake.CommitStub != nil {
return fake.CommitStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.commitReturns
return fakeReturns.result1
}
func (fake *Create) CommitCallCount() int {
fake.commitMutex.RLock()
defer fake.commitMutex.RUnlock()
return len(fake.commitArgsForCall)
}
func (fake *Create) CommitCalls(stub func(string) error) {
fake.commitMutex.Lock()
defer fake.commitMutex.Unlock()
fake.CommitStub = stub
}
func (fake *Create) CommitArgsForCall(i int) string {
fake.commitMutex.RLock()
defer fake.commitMutex.RUnlock()
argsForCall := fake.commitArgsForCall[i]
return argsForCall.arg1
}
func (fake *Create) CommitReturns(result1 error) {
fake.commitMutex.Lock()
defer fake.commitMutex.Unlock()
fake.CommitStub = nil
fake.commitReturns = struct {
result1 error
}{result1}
}
func (fake *Create) CommitReturnsOnCall(i int, result1 error) {
fake.commitMutex.Lock()
defer fake.commitMutex.Unlock()
fake.CommitStub = nil
if fake.commitReturnsOnCall == nil {
fake.commitReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.commitReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *Create) Exec(arg1 string, arg2 string, arg3 ...interface{}) (sql.Result, error) {
fake.execMutex.Lock()
ret, specificReturn := fake.execReturnsOnCall[len(fake.execArgsForCall)]
fake.execArgsForCall = append(fake.execArgsForCall, struct {
arg1 string
arg2 string
arg3 []interface{}
}{arg1, arg2, arg3})
fake.recordInvocation("Exec", []interface{}{arg1, arg2, arg3})
fake.execMutex.Unlock()
if fake.ExecStub != nil {
return fake.ExecStub(arg1, arg2, arg3...)
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.execReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *Create) ExecCallCount() int {
fake.execMutex.RLock()
defer fake.execMutex.RUnlock()
return len(fake.execArgsForCall)
}
func (fake *Create) ExecCalls(stub func(string, string, ...interface{}) (sql.Result, error)) {
fake.execMutex.Lock()
defer fake.execMutex.Unlock()
fake.ExecStub = stub
}
func (fake *Create) ExecArgsForCall(i int) (string, string, []interface{}) {
fake.execMutex.RLock()
defer fake.execMutex.RUnlock()
argsForCall := fake.execArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}
func (fake *Create) ExecReturns(result1 sql.Result, result2 error) {
fake.execMutex.Lock()
defer fake.execMutex.Unlock()
fake.ExecStub = nil
fake.execReturns = struct {
result1 sql.Result
result2 error
}{result1, result2}
}
func (fake *Create) ExecReturnsOnCall(i int, result1 sql.Result, result2 error) {
fake.execMutex.Lock()
defer fake.execMutex.Unlock()
fake.ExecStub = nil
if fake.execReturnsOnCall == nil {
fake.execReturnsOnCall = make(map[int]struct {
result1 sql.Result
result2 error
})
}
fake.execReturnsOnCall[i] = struct {
result1 sql.Result
result2 error
}{result1, result2}
}
func (fake *Create) Rebind(arg1 string) string {
fake.rebindMutex.Lock()
ret, specificReturn := fake.rebindReturnsOnCall[len(fake.rebindArgsForCall)]
fake.rebindArgsForCall = append(fake.rebindArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("Rebind", []interface{}{arg1})
fake.rebindMutex.Unlock()
if fake.RebindStub != nil {
return fake.RebindStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.rebindReturns
return fakeReturns.result1
}
func (fake *Create) RebindCallCount() int {
fake.rebindMutex.RLock()
defer fake.rebindMutex.RUnlock()
return len(fake.rebindArgsForCall)
}
func (fake *Create) RebindCalls(stub func(string) string) {
fake.rebindMutex.Lock()
defer fake.rebindMutex.Unlock()
fake.RebindStub = stub
}
func (fake *Create) RebindArgsForCall(i int) string {
fake.rebindMutex.RLock()
defer fake.rebindMutex.RUnlock()
argsForCall := fake.rebindArgsForCall[i]
return argsForCall.arg1
}
func (fake *Create) RebindReturns(result1 string) {
fake.rebindMutex.Lock()
defer fake.rebindMutex.Unlock()
fake.RebindStub = nil
fake.rebindReturns = struct {
result1 string
}{result1}
}
func (fake *Create) RebindReturnsOnCall(i int, result1 string) {
fake.rebindMutex.Lock()
defer fake.rebindMutex.Unlock()
fake.RebindStub = nil
if fake.rebindReturnsOnCall == nil {
fake.rebindReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.rebindReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *Create) Rollback(arg1 string) error {
fake.rollbackMutex.Lock()
ret, specificReturn := fake.rollbackReturnsOnCall[len(fake.rollbackArgsForCall)]
fake.rollbackArgsForCall = append(fake.rollbackArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("Rollback", []interface{}{arg1})
fake.rollbackMutex.Unlock()
if fake.RollbackStub != nil {
return fake.RollbackStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.rollbackReturns
return fakeReturns.result1
}
func (fake *Create) RollbackCallCount() int {
fake.rollbackMutex.RLock()
defer fake.rollbackMutex.RUnlock()
return len(fake.rollbackArgsForCall)
}
func (fake *Create) RollbackCalls(stub func(string) error) {
fake.rollbackMutex.Lock()
defer fake.rollbackMutex.Unlock()
fake.RollbackStub = stub
}
func (fake *Create) RollbackArgsForCall(i int) string {
fake.rollbackMutex.RLock()
defer fake.rollbackMutex.RUnlock()
argsForCall := fake.rollbackArgsForCall[i]
return argsForCall.arg1
}
func (fake *Create) RollbackReturns(result1 error) {
fake.rollbackMutex.Lock()
defer fake.rollbackMutex.Unlock()
fake.RollbackStub = nil
fake.rollbackReturns = struct {
result1 error
}{result1}
}
func (fake *Create) RollbackReturnsOnCall(i int, result1 error) {
fake.rollbackMutex.Lock()
defer fake.rollbackMutex.Unlock()
fake.RollbackStub = nil
if fake.rollbackReturnsOnCall == nil {
fake.rollbackReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.rollbackReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *Create) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.commitMutex.RLock()
defer fake.commitMutex.RUnlock()
fake.execMutex.RLock()
defer fake.execMutex.RUnlock()
fake.rebindMutex.RLock()
defer fake.rebindMutex.RUnlock()
fake.rollbackMutex.RLock()
defer fake.rollbackMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *Create) 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 _ sqlite.Create = new(Create)