-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathIndexRepo.go
625 lines (511 loc) · 19.5 KB
/
IndexRepo.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
// Code generated by mockery v2.43.0. DO NOT EDIT.
package mocks
import (
context "context"
index "github.com/bangumi/server/internal/index"
mock "github.com/stretchr/testify/mock"
model "github.com/bangumi/server/internal/model"
)
// IndexRepo is an autogenerated mock type for the Repo type
type IndexRepo struct {
mock.Mock
}
type IndexRepo_Expecter struct {
mock *mock.Mock
}
func (_m *IndexRepo) EXPECT() *IndexRepo_Expecter {
return &IndexRepo_Expecter{mock: &_m.Mock}
}
// AddIndexCollect provides a mock function with given fields: ctx, id, uid
func (_m *IndexRepo) AddIndexCollect(ctx context.Context, id uint32, uid uint32) error {
ret := _m.Called(ctx, id, uid)
if len(ret) == 0 {
panic("no return value specified for AddIndexCollect")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint32) error); ok {
r0 = rf(ctx, id, uid)
} else {
r0 = ret.Error(0)
}
return r0
}
// IndexRepo_AddIndexCollect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddIndexCollect'
type IndexRepo_AddIndexCollect_Call struct {
*mock.Call
}
// AddIndexCollect is a helper method to define mock.On call
// - ctx context.Context
// - id uint32
// - uid uint32
func (_e *IndexRepo_Expecter) AddIndexCollect(ctx interface{}, id interface{}, uid interface{}) *IndexRepo_AddIndexCollect_Call {
return &IndexRepo_AddIndexCollect_Call{Call: _e.mock.On("AddIndexCollect", ctx, id, uid)}
}
func (_c *IndexRepo_AddIndexCollect_Call) Run(run func(ctx context.Context, id uint32, uid uint32)) *IndexRepo_AddIndexCollect_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(uint32))
})
return _c
}
func (_c *IndexRepo_AddIndexCollect_Call) Return(_a0 error) *IndexRepo_AddIndexCollect_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *IndexRepo_AddIndexCollect_Call) RunAndReturn(run func(context.Context, uint32, uint32) error) *IndexRepo_AddIndexCollect_Call {
_c.Call.Return(run)
return _c
}
// AddOrUpdateIndexSubject provides a mock function with given fields: ctx, id, subjectID, sort, comment
func (_m *IndexRepo) AddOrUpdateIndexSubject(ctx context.Context, id uint32, subjectID uint32, sort uint32, comment string) (*index.Subject, error) {
ret := _m.Called(ctx, id, subjectID, sort, comment)
if len(ret) == 0 {
panic("no return value specified for AddOrUpdateIndexSubject")
}
var r0 *index.Subject
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint32, uint32, string) (*index.Subject, error)); ok {
return rf(ctx, id, subjectID, sort, comment)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint32, uint32, string) *index.Subject); ok {
r0 = rf(ctx, id, subjectID, sort, comment)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*index.Subject)
}
}
if rf, ok := ret.Get(1).(func(context.Context, uint32, uint32, uint32, string) error); ok {
r1 = rf(ctx, id, subjectID, sort, comment)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// IndexRepo_AddOrUpdateIndexSubject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddOrUpdateIndexSubject'
type IndexRepo_AddOrUpdateIndexSubject_Call struct {
*mock.Call
}
// AddOrUpdateIndexSubject is a helper method to define mock.On call
// - ctx context.Context
// - id uint32
// - subjectID uint32
// - sort uint32
// - comment string
func (_e *IndexRepo_Expecter) AddOrUpdateIndexSubject(ctx interface{}, id interface{}, subjectID interface{}, sort interface{}, comment interface{}) *IndexRepo_AddOrUpdateIndexSubject_Call {
return &IndexRepo_AddOrUpdateIndexSubject_Call{Call: _e.mock.On("AddOrUpdateIndexSubject", ctx, id, subjectID, sort, comment)}
}
func (_c *IndexRepo_AddOrUpdateIndexSubject_Call) Run(run func(ctx context.Context, id uint32, subjectID uint32, sort uint32, comment string)) *IndexRepo_AddOrUpdateIndexSubject_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(uint32), args[3].(uint32), args[4].(string))
})
return _c
}
func (_c *IndexRepo_AddOrUpdateIndexSubject_Call) Return(_a0 *index.Subject, _a1 error) *IndexRepo_AddOrUpdateIndexSubject_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *IndexRepo_AddOrUpdateIndexSubject_Call) RunAndReturn(run func(context.Context, uint32, uint32, uint32, string) (*index.Subject, error)) *IndexRepo_AddOrUpdateIndexSubject_Call {
_c.Call.Return(run)
return _c
}
// CountSubjects provides a mock function with given fields: ctx, id, subjectType
func (_m *IndexRepo) CountSubjects(ctx context.Context, id uint32, subjectType uint8) (int64, error) {
ret := _m.Called(ctx, id, subjectType)
if len(ret) == 0 {
panic("no return value specified for CountSubjects")
}
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint8) (int64, error)); ok {
return rf(ctx, id, subjectType)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint8) int64); ok {
r0 = rf(ctx, id, subjectType)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(context.Context, uint32, uint8) error); ok {
r1 = rf(ctx, id, subjectType)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// IndexRepo_CountSubjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountSubjects'
type IndexRepo_CountSubjects_Call struct {
*mock.Call
}
// CountSubjects is a helper method to define mock.On call
// - ctx context.Context
// - id uint32
// - subjectType uint8
func (_e *IndexRepo_Expecter) CountSubjects(ctx interface{}, id interface{}, subjectType interface{}) *IndexRepo_CountSubjects_Call {
return &IndexRepo_CountSubjects_Call{Call: _e.mock.On("CountSubjects", ctx, id, subjectType)}
}
func (_c *IndexRepo_CountSubjects_Call) Run(run func(ctx context.Context, id uint32, subjectType uint8)) *IndexRepo_CountSubjects_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(uint8))
})
return _c
}
func (_c *IndexRepo_CountSubjects_Call) Return(_a0 int64, _a1 error) *IndexRepo_CountSubjects_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *IndexRepo_CountSubjects_Call) RunAndReturn(run func(context.Context, uint32, uint8) (int64, error)) *IndexRepo_CountSubjects_Call {
_c.Call.Return(run)
return _c
}
// Delete provides a mock function with given fields: ctx, id
func (_m *IndexRepo) Delete(ctx context.Context, id uint32) error {
ret := _m.Called(ctx, id)
if len(ret) == 0 {
panic("no return value specified for Delete")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, uint32) error); ok {
r0 = rf(ctx, id)
} else {
r0 = ret.Error(0)
}
return r0
}
// IndexRepo_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
type IndexRepo_Delete_Call struct {
*mock.Call
}
// Delete is a helper method to define mock.On call
// - ctx context.Context
// - id uint32
func (_e *IndexRepo_Expecter) Delete(ctx interface{}, id interface{}) *IndexRepo_Delete_Call {
return &IndexRepo_Delete_Call{Call: _e.mock.On("Delete", ctx, id)}
}
func (_c *IndexRepo_Delete_Call) Run(run func(ctx context.Context, id uint32)) *IndexRepo_Delete_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32))
})
return _c
}
func (_c *IndexRepo_Delete_Call) Return(_a0 error) *IndexRepo_Delete_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *IndexRepo_Delete_Call) RunAndReturn(run func(context.Context, uint32) error) *IndexRepo_Delete_Call {
_c.Call.Return(run)
return _c
}
// DeleteIndexCollect provides a mock function with given fields: ctx, id, uid
func (_m *IndexRepo) DeleteIndexCollect(ctx context.Context, id uint32, uid uint32) error {
ret := _m.Called(ctx, id, uid)
if len(ret) == 0 {
panic("no return value specified for DeleteIndexCollect")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint32) error); ok {
r0 = rf(ctx, id, uid)
} else {
r0 = ret.Error(0)
}
return r0
}
// IndexRepo_DeleteIndexCollect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteIndexCollect'
type IndexRepo_DeleteIndexCollect_Call struct {
*mock.Call
}
// DeleteIndexCollect is a helper method to define mock.On call
// - ctx context.Context
// - id uint32
// - uid uint32
func (_e *IndexRepo_Expecter) DeleteIndexCollect(ctx interface{}, id interface{}, uid interface{}) *IndexRepo_DeleteIndexCollect_Call {
return &IndexRepo_DeleteIndexCollect_Call{Call: _e.mock.On("DeleteIndexCollect", ctx, id, uid)}
}
func (_c *IndexRepo_DeleteIndexCollect_Call) Run(run func(ctx context.Context, id uint32, uid uint32)) *IndexRepo_DeleteIndexCollect_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(uint32))
})
return _c
}
func (_c *IndexRepo_DeleteIndexCollect_Call) Return(_a0 error) *IndexRepo_DeleteIndexCollect_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *IndexRepo_DeleteIndexCollect_Call) RunAndReturn(run func(context.Context, uint32, uint32) error) *IndexRepo_DeleteIndexCollect_Call {
_c.Call.Return(run)
return _c
}
// DeleteIndexSubject provides a mock function with given fields: ctx, id, subjectID
func (_m *IndexRepo) DeleteIndexSubject(ctx context.Context, id uint32, subjectID uint32) error {
ret := _m.Called(ctx, id, subjectID)
if len(ret) == 0 {
panic("no return value specified for DeleteIndexSubject")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint32) error); ok {
r0 = rf(ctx, id, subjectID)
} else {
r0 = ret.Error(0)
}
return r0
}
// IndexRepo_DeleteIndexSubject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteIndexSubject'
type IndexRepo_DeleteIndexSubject_Call struct {
*mock.Call
}
// DeleteIndexSubject is a helper method to define mock.On call
// - ctx context.Context
// - id uint32
// - subjectID uint32
func (_e *IndexRepo_Expecter) DeleteIndexSubject(ctx interface{}, id interface{}, subjectID interface{}) *IndexRepo_DeleteIndexSubject_Call {
return &IndexRepo_DeleteIndexSubject_Call{Call: _e.mock.On("DeleteIndexSubject", ctx, id, subjectID)}
}
func (_c *IndexRepo_DeleteIndexSubject_Call) Run(run func(ctx context.Context, id uint32, subjectID uint32)) *IndexRepo_DeleteIndexSubject_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(uint32))
})
return _c
}
func (_c *IndexRepo_DeleteIndexSubject_Call) Return(_a0 error) *IndexRepo_DeleteIndexSubject_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *IndexRepo_DeleteIndexSubject_Call) RunAndReturn(run func(context.Context, uint32, uint32) error) *IndexRepo_DeleteIndexSubject_Call {
_c.Call.Return(run)
return _c
}
// Get provides a mock function with given fields: ctx, id
func (_m *IndexRepo) Get(ctx context.Context, id uint32) (model.Index, error) {
ret := _m.Called(ctx, id)
if len(ret) == 0 {
panic("no return value specified for Get")
}
var r0 model.Index
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32) (model.Index, error)); ok {
return rf(ctx, id)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32) model.Index); ok {
r0 = rf(ctx, id)
} else {
r0 = ret.Get(0).(model.Index)
}
if rf, ok := ret.Get(1).(func(context.Context, uint32) error); ok {
r1 = rf(ctx, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// IndexRepo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
type IndexRepo_Get_Call struct {
*mock.Call
}
// Get is a helper method to define mock.On call
// - ctx context.Context
// - id uint32
func (_e *IndexRepo_Expecter) Get(ctx interface{}, id interface{}) *IndexRepo_Get_Call {
return &IndexRepo_Get_Call{Call: _e.mock.On("Get", ctx, id)}
}
func (_c *IndexRepo_Get_Call) Run(run func(ctx context.Context, id uint32)) *IndexRepo_Get_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32))
})
return _c
}
func (_c *IndexRepo_Get_Call) Return(_a0 model.Index, _a1 error) *IndexRepo_Get_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *IndexRepo_Get_Call) RunAndReturn(run func(context.Context, uint32) (model.Index, error)) *IndexRepo_Get_Call {
_c.Call.Return(run)
return _c
}
// GetIndexCollect provides a mock function with given fields: ctx, id, uid
func (_m *IndexRepo) GetIndexCollect(ctx context.Context, id uint32, uid uint32) (*index.IndexCollect, error) {
ret := _m.Called(ctx, id, uid)
if len(ret) == 0 {
panic("no return value specified for GetIndexCollect")
}
var r0 *index.IndexCollect
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint32) (*index.IndexCollect, error)); ok {
return rf(ctx, id, uid)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint32) *index.IndexCollect); ok {
r0 = rf(ctx, id, uid)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*index.IndexCollect)
}
}
if rf, ok := ret.Get(1).(func(context.Context, uint32, uint32) error); ok {
r1 = rf(ctx, id, uid)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// IndexRepo_GetIndexCollect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIndexCollect'
type IndexRepo_GetIndexCollect_Call struct {
*mock.Call
}
// GetIndexCollect is a helper method to define mock.On call
// - ctx context.Context
// - id uint32
// - uid uint32
func (_e *IndexRepo_Expecter) GetIndexCollect(ctx interface{}, id interface{}, uid interface{}) *IndexRepo_GetIndexCollect_Call {
return &IndexRepo_GetIndexCollect_Call{Call: _e.mock.On("GetIndexCollect", ctx, id, uid)}
}
func (_c *IndexRepo_GetIndexCollect_Call) Run(run func(ctx context.Context, id uint32, uid uint32)) *IndexRepo_GetIndexCollect_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(uint32))
})
return _c
}
func (_c *IndexRepo_GetIndexCollect_Call) Return(_a0 *index.IndexCollect, _a1 error) *IndexRepo_GetIndexCollect_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *IndexRepo_GetIndexCollect_Call) RunAndReturn(run func(context.Context, uint32, uint32) (*index.IndexCollect, error)) *IndexRepo_GetIndexCollect_Call {
_c.Call.Return(run)
return _c
}
// ListSubjects provides a mock function with given fields: ctx, id, subjectType, limit, offset
func (_m *IndexRepo) ListSubjects(ctx context.Context, id uint32, subjectType uint8, limit int, offset int) ([]index.Subject, error) {
ret := _m.Called(ctx, id, subjectType, limit, offset)
if len(ret) == 0 {
panic("no return value specified for ListSubjects")
}
var r0 []index.Subject
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint8, int, int) ([]index.Subject, error)); ok {
return rf(ctx, id, subjectType, limit, offset)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32, uint8, int, int) []index.Subject); ok {
r0 = rf(ctx, id, subjectType, limit, offset)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]index.Subject)
}
}
if rf, ok := ret.Get(1).(func(context.Context, uint32, uint8, int, int) error); ok {
r1 = rf(ctx, id, subjectType, limit, offset)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// IndexRepo_ListSubjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSubjects'
type IndexRepo_ListSubjects_Call struct {
*mock.Call
}
// ListSubjects is a helper method to define mock.On call
// - ctx context.Context
// - id uint32
// - subjectType uint8
// - limit int
// - offset int
func (_e *IndexRepo_Expecter) ListSubjects(ctx interface{}, id interface{}, subjectType interface{}, limit interface{}, offset interface{}) *IndexRepo_ListSubjects_Call {
return &IndexRepo_ListSubjects_Call{Call: _e.mock.On("ListSubjects", ctx, id, subjectType, limit, offset)}
}
func (_c *IndexRepo_ListSubjects_Call) Run(run func(ctx context.Context, id uint32, subjectType uint8, limit int, offset int)) *IndexRepo_ListSubjects_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(uint8), args[3].(int), args[4].(int))
})
return _c
}
func (_c *IndexRepo_ListSubjects_Call) Return(_a0 []index.Subject, _a1 error) *IndexRepo_ListSubjects_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *IndexRepo_ListSubjects_Call) RunAndReturn(run func(context.Context, uint32, uint8, int, int) ([]index.Subject, error)) *IndexRepo_ListSubjects_Call {
_c.Call.Return(run)
return _c
}
// New provides a mock function with given fields: ctx, i
func (_m *IndexRepo) New(ctx context.Context, i *model.Index) error {
ret := _m.Called(ctx, i)
if len(ret) == 0 {
panic("no return value specified for New")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *model.Index) error); ok {
r0 = rf(ctx, i)
} else {
r0 = ret.Error(0)
}
return r0
}
// IndexRepo_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New'
type IndexRepo_New_Call struct {
*mock.Call
}
// New is a helper method to define mock.On call
// - ctx context.Context
// - i *model.Index
func (_e *IndexRepo_Expecter) New(ctx interface{}, i interface{}) *IndexRepo_New_Call {
return &IndexRepo_New_Call{Call: _e.mock.On("New", ctx, i)}
}
func (_c *IndexRepo_New_Call) Run(run func(ctx context.Context, i *model.Index)) *IndexRepo_New_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*model.Index))
})
return _c
}
func (_c *IndexRepo_New_Call) Return(_a0 error) *IndexRepo_New_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *IndexRepo_New_Call) RunAndReturn(run func(context.Context, *model.Index) error) *IndexRepo_New_Call {
_c.Call.Return(run)
return _c
}
// Update provides a mock function with given fields: ctx, id, title, desc
func (_m *IndexRepo) Update(ctx context.Context, id uint32, title string, desc string) error {
ret := _m.Called(ctx, id, title, desc)
if len(ret) == 0 {
panic("no return value specified for Update")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, uint32, string, string) error); ok {
r0 = rf(ctx, id, title, desc)
} else {
r0 = ret.Error(0)
}
return r0
}
// IndexRepo_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
type IndexRepo_Update_Call struct {
*mock.Call
}
// Update is a helper method to define mock.On call
// - ctx context.Context
// - id uint32
// - title string
// - desc string
func (_e *IndexRepo_Expecter) Update(ctx interface{}, id interface{}, title interface{}, desc interface{}) *IndexRepo_Update_Call {
return &IndexRepo_Update_Call{Call: _e.mock.On("Update", ctx, id, title, desc)}
}
func (_c *IndexRepo_Update_Call) Run(run func(ctx context.Context, id uint32, title string, desc string)) *IndexRepo_Update_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32), args[2].(string), args[3].(string))
})
return _c
}
func (_c *IndexRepo_Update_Call) Return(_a0 error) *IndexRepo_Update_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *IndexRepo_Update_Call) RunAndReturn(run func(context.Context, uint32, string, string) error) *IndexRepo_Update_Call {
_c.Call.Return(run)
return _c
}
// NewIndexRepo creates a new instance of IndexRepo. 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 NewIndexRepo(t interface {
mock.TestingT
Cleanup(func())
}) *IndexRepo {
mock := &IndexRepo{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}