forked from 0xPolygonHermez/zkevm-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mock_dbtx.go
758 lines (625 loc) · 21.8 KB
/
mock_dbtx.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
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
// Code generated by mockery. DO NOT EDIT.
package mocks
import (
context "context"
pgconn "github.com/jackc/pgconn"
mock "github.com/stretchr/testify/mock"
pgx "github.com/jackc/pgx/v4"
)
// DbTxMock is an autogenerated mock type for the Tx type
type DbTxMock struct {
mock.Mock
}
type DbTxMock_Expecter struct {
mock *mock.Mock
}
func (_m *DbTxMock) EXPECT() *DbTxMock_Expecter {
return &DbTxMock_Expecter{mock: &_m.Mock}
}
// Begin provides a mock function with given fields: ctx
func (_m *DbTxMock) Begin(ctx context.Context) (pgx.Tx, error) {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for Begin")
}
var r0 pgx.Tx
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok {
return rf(ctx)
}
if rf, ok := ret.Get(0).(func(context.Context) pgx.Tx); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(pgx.Tx)
}
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DbTxMock_Begin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Begin'
type DbTxMock_Begin_Call struct {
*mock.Call
}
// Begin is a helper method to define mock.On call
// - ctx context.Context
func (_e *DbTxMock_Expecter) Begin(ctx interface{}) *DbTxMock_Begin_Call {
return &DbTxMock_Begin_Call{Call: _e.mock.On("Begin", ctx)}
}
func (_c *DbTxMock_Begin_Call) Run(run func(ctx context.Context)) *DbTxMock_Begin_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *DbTxMock_Begin_Call) Return(_a0 pgx.Tx, _a1 error) *DbTxMock_Begin_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *DbTxMock_Begin_Call) RunAndReturn(run func(context.Context) (pgx.Tx, error)) *DbTxMock_Begin_Call {
_c.Call.Return(run)
return _c
}
// BeginFunc provides a mock function with given fields: ctx, f
func (_m *DbTxMock) BeginFunc(ctx context.Context, f func(pgx.Tx) error) error {
ret := _m.Called(ctx, f)
if len(ret) == 0 {
panic("no return value specified for BeginFunc")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, func(pgx.Tx) error) error); ok {
r0 = rf(ctx, f)
} else {
r0 = ret.Error(0)
}
return r0
}
// DbTxMock_BeginFunc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BeginFunc'
type DbTxMock_BeginFunc_Call struct {
*mock.Call
}
// BeginFunc is a helper method to define mock.On call
// - ctx context.Context
// - f func(pgx.Tx) error
func (_e *DbTxMock_Expecter) BeginFunc(ctx interface{}, f interface{}) *DbTxMock_BeginFunc_Call {
return &DbTxMock_BeginFunc_Call{Call: _e.mock.On("BeginFunc", ctx, f)}
}
func (_c *DbTxMock_BeginFunc_Call) Run(run func(ctx context.Context, f func(pgx.Tx) error)) *DbTxMock_BeginFunc_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(func(pgx.Tx) error))
})
return _c
}
func (_c *DbTxMock_BeginFunc_Call) Return(err error) *DbTxMock_BeginFunc_Call {
_c.Call.Return(err)
return _c
}
func (_c *DbTxMock_BeginFunc_Call) RunAndReturn(run func(context.Context, func(pgx.Tx) error) error) *DbTxMock_BeginFunc_Call {
_c.Call.Return(run)
return _c
}
// Commit provides a mock function with given fields: ctx
func (_m *DbTxMock) Commit(ctx context.Context) error {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for Commit")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = rf(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// DbTxMock_Commit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Commit'
type DbTxMock_Commit_Call struct {
*mock.Call
}
// Commit is a helper method to define mock.On call
// - ctx context.Context
func (_e *DbTxMock_Expecter) Commit(ctx interface{}) *DbTxMock_Commit_Call {
return &DbTxMock_Commit_Call{Call: _e.mock.On("Commit", ctx)}
}
func (_c *DbTxMock_Commit_Call) Run(run func(ctx context.Context)) *DbTxMock_Commit_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *DbTxMock_Commit_Call) Return(_a0 error) *DbTxMock_Commit_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *DbTxMock_Commit_Call) RunAndReturn(run func(context.Context) error) *DbTxMock_Commit_Call {
_c.Call.Return(run)
return _c
}
// Conn provides a mock function with given fields:
func (_m *DbTxMock) Conn() *pgx.Conn {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Conn")
}
var r0 *pgx.Conn
if rf, ok := ret.Get(0).(func() *pgx.Conn); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*pgx.Conn)
}
}
return r0
}
// DbTxMock_Conn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Conn'
type DbTxMock_Conn_Call struct {
*mock.Call
}
// Conn is a helper method to define mock.On call
func (_e *DbTxMock_Expecter) Conn() *DbTxMock_Conn_Call {
return &DbTxMock_Conn_Call{Call: _e.mock.On("Conn")}
}
func (_c *DbTxMock_Conn_Call) Run(run func()) *DbTxMock_Conn_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *DbTxMock_Conn_Call) Return(_a0 *pgx.Conn) *DbTxMock_Conn_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *DbTxMock_Conn_Call) RunAndReturn(run func() *pgx.Conn) *DbTxMock_Conn_Call {
_c.Call.Return(run)
return _c
}
// CopyFrom provides a mock function with given fields: ctx, tableName, columnNames, rowSrc
func (_m *DbTxMock) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error) {
ret := _m.Called(ctx, tableName, columnNames, rowSrc)
if len(ret) == 0 {
panic("no return value specified for CopyFrom")
}
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) (int64, error)); ok {
return rf(ctx, tableName, columnNames, rowSrc)
}
if rf, ok := ret.Get(0).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) int64); ok {
r0 = rf(ctx, tableName, columnNames, rowSrc)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) error); ok {
r1 = rf(ctx, tableName, columnNames, rowSrc)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DbTxMock_CopyFrom_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CopyFrom'
type DbTxMock_CopyFrom_Call struct {
*mock.Call
}
// CopyFrom is a helper method to define mock.On call
// - ctx context.Context
// - tableName pgx.Identifier
// - columnNames []string
// - rowSrc pgx.CopyFromSource
func (_e *DbTxMock_Expecter) CopyFrom(ctx interface{}, tableName interface{}, columnNames interface{}, rowSrc interface{}) *DbTxMock_CopyFrom_Call {
return &DbTxMock_CopyFrom_Call{Call: _e.mock.On("CopyFrom", ctx, tableName, columnNames, rowSrc)}
}
func (_c *DbTxMock_CopyFrom_Call) Run(run func(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource)) *DbTxMock_CopyFrom_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(pgx.Identifier), args[2].([]string), args[3].(pgx.CopyFromSource))
})
return _c
}
func (_c *DbTxMock_CopyFrom_Call) Return(_a0 int64, _a1 error) *DbTxMock_CopyFrom_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *DbTxMock_CopyFrom_Call) RunAndReturn(run func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) (int64, error)) *DbTxMock_CopyFrom_Call {
_c.Call.Return(run)
return _c
}
// Exec provides a mock function with given fields: ctx, sql, arguments
func (_m *DbTxMock) Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error) {
var _ca []interface{}
_ca = append(_ca, ctx, sql)
_ca = append(_ca, arguments...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for Exec")
}
var r0 pgconn.CommandTag
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (pgconn.CommandTag, error)); ok {
return rf(ctx, sql, arguments...)
}
if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) pgconn.CommandTag); ok {
r0 = rf(ctx, sql, arguments...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(pgconn.CommandTag)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok {
r1 = rf(ctx, sql, arguments...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DbTxMock_Exec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exec'
type DbTxMock_Exec_Call struct {
*mock.Call
}
// Exec is a helper method to define mock.On call
// - ctx context.Context
// - sql string
// - arguments ...interface{}
func (_e *DbTxMock_Expecter) Exec(ctx interface{}, sql interface{}, arguments ...interface{}) *DbTxMock_Exec_Call {
return &DbTxMock_Exec_Call{Call: _e.mock.On("Exec",
append([]interface{}{ctx, sql}, arguments...)...)}
}
func (_c *DbTxMock_Exec_Call) Run(run func(ctx context.Context, sql string, arguments ...interface{})) *DbTxMock_Exec_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]interface{}, len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(interface{})
}
}
run(args[0].(context.Context), args[1].(string), variadicArgs...)
})
return _c
}
func (_c *DbTxMock_Exec_Call) Return(commandTag pgconn.CommandTag, err error) *DbTxMock_Exec_Call {
_c.Call.Return(commandTag, err)
return _c
}
func (_c *DbTxMock_Exec_Call) RunAndReturn(run func(context.Context, string, ...interface{}) (pgconn.CommandTag, error)) *DbTxMock_Exec_Call {
_c.Call.Return(run)
return _c
}
// LargeObjects provides a mock function with given fields:
func (_m *DbTxMock) LargeObjects() pgx.LargeObjects {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for LargeObjects")
}
var r0 pgx.LargeObjects
if rf, ok := ret.Get(0).(func() pgx.LargeObjects); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(pgx.LargeObjects)
}
return r0
}
// DbTxMock_LargeObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LargeObjects'
type DbTxMock_LargeObjects_Call struct {
*mock.Call
}
// LargeObjects is a helper method to define mock.On call
func (_e *DbTxMock_Expecter) LargeObjects() *DbTxMock_LargeObjects_Call {
return &DbTxMock_LargeObjects_Call{Call: _e.mock.On("LargeObjects")}
}
func (_c *DbTxMock_LargeObjects_Call) Run(run func()) *DbTxMock_LargeObjects_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *DbTxMock_LargeObjects_Call) Return(_a0 pgx.LargeObjects) *DbTxMock_LargeObjects_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *DbTxMock_LargeObjects_Call) RunAndReturn(run func() pgx.LargeObjects) *DbTxMock_LargeObjects_Call {
_c.Call.Return(run)
return _c
}
// Prepare provides a mock function with given fields: ctx, name, sql
func (_m *DbTxMock) Prepare(ctx context.Context, name string, sql string) (*pgconn.StatementDescription, error) {
ret := _m.Called(ctx, name, sql)
if len(ret) == 0 {
panic("no return value specified for Prepare")
}
var r0 *pgconn.StatementDescription
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*pgconn.StatementDescription, error)); ok {
return rf(ctx, name, sql)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string) *pgconn.StatementDescription); ok {
r0 = rf(ctx, name, sql)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*pgconn.StatementDescription)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = rf(ctx, name, sql)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DbTxMock_Prepare_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Prepare'
type DbTxMock_Prepare_Call struct {
*mock.Call
}
// Prepare is a helper method to define mock.On call
// - ctx context.Context
// - name string
// - sql string
func (_e *DbTxMock_Expecter) Prepare(ctx interface{}, name interface{}, sql interface{}) *DbTxMock_Prepare_Call {
return &DbTxMock_Prepare_Call{Call: _e.mock.On("Prepare", ctx, name, sql)}
}
func (_c *DbTxMock_Prepare_Call) Run(run func(ctx context.Context, name string, sql string)) *DbTxMock_Prepare_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(string))
})
return _c
}
func (_c *DbTxMock_Prepare_Call) Return(_a0 *pgconn.StatementDescription, _a1 error) *DbTxMock_Prepare_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *DbTxMock_Prepare_Call) RunAndReturn(run func(context.Context, string, string) (*pgconn.StatementDescription, error)) *DbTxMock_Prepare_Call {
_c.Call.Return(run)
return _c
}
// Query provides a mock function with given fields: ctx, sql, args
func (_m *DbTxMock) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error) {
var _ca []interface{}
_ca = append(_ca, ctx, sql)
_ca = append(_ca, args...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for Query")
}
var r0 pgx.Rows
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (pgx.Rows, error)); ok {
return rf(ctx, sql, args...)
}
if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) pgx.Rows); ok {
r0 = rf(ctx, sql, args...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(pgx.Rows)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok {
r1 = rf(ctx, sql, args...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DbTxMock_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query'
type DbTxMock_Query_Call struct {
*mock.Call
}
// Query is a helper method to define mock.On call
// - ctx context.Context
// - sql string
// - args ...interface{}
func (_e *DbTxMock_Expecter) Query(ctx interface{}, sql interface{}, args ...interface{}) *DbTxMock_Query_Call {
return &DbTxMock_Query_Call{Call: _e.mock.On("Query",
append([]interface{}{ctx, sql}, args...)...)}
}
func (_c *DbTxMock_Query_Call) Run(run func(ctx context.Context, sql string, args ...interface{})) *DbTxMock_Query_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]interface{}, len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(interface{})
}
}
run(args[0].(context.Context), args[1].(string), variadicArgs...)
})
return _c
}
func (_c *DbTxMock_Query_Call) Return(_a0 pgx.Rows, _a1 error) *DbTxMock_Query_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *DbTxMock_Query_Call) RunAndReturn(run func(context.Context, string, ...interface{}) (pgx.Rows, error)) *DbTxMock_Query_Call {
_c.Call.Return(run)
return _c
}
// QueryFunc provides a mock function with given fields: ctx, sql, args, scans, f
func (_m *DbTxMock) QueryFunc(ctx context.Context, sql string, args []interface{}, scans []interface{}, f func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error) {
ret := _m.Called(ctx, sql, args, scans, f)
if len(ret) == 0 {
panic("no return value specified for QueryFunc")
}
var r0 pgconn.CommandTag
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error)); ok {
return rf(ctx, sql, args, scans, f)
}
if rf, ok := ret.Get(0).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) pgconn.CommandTag); ok {
r0 = rf(ctx, sql, args, scans, f)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(pgconn.CommandTag)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) error); ok {
r1 = rf(ctx, sql, args, scans, f)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DbTxMock_QueryFunc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryFunc'
type DbTxMock_QueryFunc_Call struct {
*mock.Call
}
// QueryFunc is a helper method to define mock.On call
// - ctx context.Context
// - sql string
// - args []interface{}
// - scans []interface{}
// - f func(pgx.QueryFuncRow) error
func (_e *DbTxMock_Expecter) QueryFunc(ctx interface{}, sql interface{}, args interface{}, scans interface{}, f interface{}) *DbTxMock_QueryFunc_Call {
return &DbTxMock_QueryFunc_Call{Call: _e.mock.On("QueryFunc", ctx, sql, args, scans, f)}
}
func (_c *DbTxMock_QueryFunc_Call) Run(run func(ctx context.Context, sql string, args []interface{}, scans []interface{}, f func(pgx.QueryFuncRow) error)) *DbTxMock_QueryFunc_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].([]interface{}), args[3].([]interface{}), args[4].(func(pgx.QueryFuncRow) error))
})
return _c
}
func (_c *DbTxMock_QueryFunc_Call) Return(_a0 pgconn.CommandTag, _a1 error) *DbTxMock_QueryFunc_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *DbTxMock_QueryFunc_Call) RunAndReturn(run func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error)) *DbTxMock_QueryFunc_Call {
_c.Call.Return(run)
return _c
}
// QueryRow provides a mock function with given fields: ctx, sql, args
func (_m *DbTxMock) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row {
var _ca []interface{}
_ca = append(_ca, ctx, sql)
_ca = append(_ca, args...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for QueryRow")
}
var r0 pgx.Row
if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) pgx.Row); ok {
r0 = rf(ctx, sql, args...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(pgx.Row)
}
}
return r0
}
// DbTxMock_QueryRow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryRow'
type DbTxMock_QueryRow_Call struct {
*mock.Call
}
// QueryRow is a helper method to define mock.On call
// - ctx context.Context
// - sql string
// - args ...interface{}
func (_e *DbTxMock_Expecter) QueryRow(ctx interface{}, sql interface{}, args ...interface{}) *DbTxMock_QueryRow_Call {
return &DbTxMock_QueryRow_Call{Call: _e.mock.On("QueryRow",
append([]interface{}{ctx, sql}, args...)...)}
}
func (_c *DbTxMock_QueryRow_Call) Run(run func(ctx context.Context, sql string, args ...interface{})) *DbTxMock_QueryRow_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]interface{}, len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(interface{})
}
}
run(args[0].(context.Context), args[1].(string), variadicArgs...)
})
return _c
}
func (_c *DbTxMock_QueryRow_Call) Return(_a0 pgx.Row) *DbTxMock_QueryRow_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *DbTxMock_QueryRow_Call) RunAndReturn(run func(context.Context, string, ...interface{}) pgx.Row) *DbTxMock_QueryRow_Call {
_c.Call.Return(run)
return _c
}
// Rollback provides a mock function with given fields: ctx
func (_m *DbTxMock) Rollback(ctx context.Context) error {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for Rollback")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = rf(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// DbTxMock_Rollback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Rollback'
type DbTxMock_Rollback_Call struct {
*mock.Call
}
// Rollback is a helper method to define mock.On call
// - ctx context.Context
func (_e *DbTxMock_Expecter) Rollback(ctx interface{}) *DbTxMock_Rollback_Call {
return &DbTxMock_Rollback_Call{Call: _e.mock.On("Rollback", ctx)}
}
func (_c *DbTxMock_Rollback_Call) Run(run func(ctx context.Context)) *DbTxMock_Rollback_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *DbTxMock_Rollback_Call) Return(_a0 error) *DbTxMock_Rollback_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *DbTxMock_Rollback_Call) RunAndReturn(run func(context.Context) error) *DbTxMock_Rollback_Call {
_c.Call.Return(run)
return _c
}
// SendBatch provides a mock function with given fields: ctx, b
func (_m *DbTxMock) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults {
ret := _m.Called(ctx, b)
if len(ret) == 0 {
panic("no return value specified for SendBatch")
}
var r0 pgx.BatchResults
if rf, ok := ret.Get(0).(func(context.Context, *pgx.Batch) pgx.BatchResults); ok {
r0 = rf(ctx, b)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(pgx.BatchResults)
}
}
return r0
}
// DbTxMock_SendBatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendBatch'
type DbTxMock_SendBatch_Call struct {
*mock.Call
}
// SendBatch is a helper method to define mock.On call
// - ctx context.Context
// - b *pgx.Batch
func (_e *DbTxMock_Expecter) SendBatch(ctx interface{}, b interface{}) *DbTxMock_SendBatch_Call {
return &DbTxMock_SendBatch_Call{Call: _e.mock.On("SendBatch", ctx, b)}
}
func (_c *DbTxMock_SendBatch_Call) Run(run func(ctx context.Context, b *pgx.Batch)) *DbTxMock_SendBatch_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*pgx.Batch))
})
return _c
}
func (_c *DbTxMock_SendBatch_Call) Return(_a0 pgx.BatchResults) *DbTxMock_SendBatch_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *DbTxMock_SendBatch_Call) RunAndReturn(run func(context.Context, *pgx.Batch) pgx.BatchResults) *DbTxMock_SendBatch_Call {
_c.Call.Return(run)
return _c
}
// NewDbTxMock creates a new instance of DbTxMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewDbTxMock(t interface {
mock.TestingT
Cleanup(func())
}) *DbTxMock {
mock := &DbTxMock{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}