-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathCollectionsRepo.go
More file actions
1052 lines (939 loc) · 39.2 KB
/
Copy pathCollectionsRepo.go
File metadata and controls
1052 lines (939 loc) · 39.2 KB
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
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"time"
"github.com/bangumi/server/dal/query"
"github.com/bangumi/server/internal/collections"
"github.com/bangumi/server/internal/collections/domain/collection"
"github.com/bangumi/server/internal/model"
mock "github.com/stretchr/testify/mock"
)
// NewCollectionsRepo creates a new instance of CollectionsRepo. 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 NewCollectionsRepo(t interface {
mock.TestingT
Cleanup(func())
}) *CollectionsRepo {
mock := &CollectionsRepo{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// CollectionsRepo is an autogenerated mock type for the Repo type
type CollectionsRepo struct {
mock.Mock
}
type CollectionsRepo_Expecter struct {
mock *mock.Mock
}
func (_m *CollectionsRepo) EXPECT() *CollectionsRepo_Expecter {
return &CollectionsRepo_Expecter{mock: &_m.Mock}
}
// AddPersonCollection provides a mock function for the type CollectionsRepo
func (_mock *CollectionsRepo) AddPersonCollection(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory, targetID model.PersonID) error {
ret := _mock.Called(ctx, userID, cat, targetID)
if len(ret) == 0 {
panic("no return value specified for AddPersonCollection")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, collection.PersonCollectCategory, model.PersonID) error); ok {
r0 = returnFunc(ctx, userID, cat, targetID)
} else {
r0 = ret.Error(0)
}
return r0
}
// CollectionsRepo_AddPersonCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddPersonCollection'
type CollectionsRepo_AddPersonCollection_Call struct {
*mock.Call
}
// AddPersonCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID model.UserID
// - cat collection.PersonCollectCategory
// - targetID model.PersonID
func (_e *CollectionsRepo_Expecter) AddPersonCollection(ctx interface{}, userID interface{}, cat interface{}, targetID interface{}) *CollectionsRepo_AddPersonCollection_Call {
return &CollectionsRepo_AddPersonCollection_Call{Call: _e.mock.On("AddPersonCollection", ctx, userID, cat, targetID)}
}
func (_c *CollectionsRepo_AddPersonCollection_Call) Run(run func(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory, targetID model.PersonID)) *CollectionsRepo_AddPersonCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 model.UserID
if args[1] != nil {
arg1 = args[1].(model.UserID)
}
var arg2 collection.PersonCollectCategory
if args[2] != nil {
arg2 = args[2].(collection.PersonCollectCategory)
}
var arg3 model.PersonID
if args[3] != nil {
arg3 = args[3].(model.PersonID)
}
run(
arg0,
arg1,
arg2,
arg3,
)
})
return _c
}
func (_c *CollectionsRepo_AddPersonCollection_Call) Return(err error) *CollectionsRepo_AddPersonCollection_Call {
_c.Call.Return(err)
return _c
}
func (_c *CollectionsRepo_AddPersonCollection_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory, targetID model.PersonID) error) *CollectionsRepo_AddPersonCollection_Call {
_c.Call.Return(run)
return _c
}
// CountPersonCollections provides a mock function for the type CollectionsRepo
func (_mock *CollectionsRepo) CountPersonCollections(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory) (int64, error) {
ret := _mock.Called(ctx, userID, cat)
if len(ret) == 0 {
panic("no return value specified for CountPersonCollections")
}
var r0 int64
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, collection.PersonCollectCategory) (int64, error)); ok {
return returnFunc(ctx, userID, cat)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, collection.PersonCollectCategory) int64); ok {
r0 = returnFunc(ctx, userID, cat)
} else {
r0 = ret.Get(0).(int64)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, model.UserID, collection.PersonCollectCategory) error); ok {
r1 = returnFunc(ctx, userID, cat)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionsRepo_CountPersonCollections_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountPersonCollections'
type CollectionsRepo_CountPersonCollections_Call struct {
*mock.Call
}
// CountPersonCollections is a helper method to define mock.On call
// - ctx context.Context
// - userID model.UserID
// - cat collection.PersonCollectCategory
func (_e *CollectionsRepo_Expecter) CountPersonCollections(ctx interface{}, userID interface{}, cat interface{}) *CollectionsRepo_CountPersonCollections_Call {
return &CollectionsRepo_CountPersonCollections_Call{Call: _e.mock.On("CountPersonCollections", ctx, userID, cat)}
}
func (_c *CollectionsRepo_CountPersonCollections_Call) Run(run func(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory)) *CollectionsRepo_CountPersonCollections_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 model.UserID
if args[1] != nil {
arg1 = args[1].(model.UserID)
}
var arg2 collection.PersonCollectCategory
if args[2] != nil {
arg2 = args[2].(collection.PersonCollectCategory)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *CollectionsRepo_CountPersonCollections_Call) Return(n int64, err error) *CollectionsRepo_CountPersonCollections_Call {
_c.Call.Return(n, err)
return _c
}
func (_c *CollectionsRepo_CountPersonCollections_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory) (int64, error)) *CollectionsRepo_CountPersonCollections_Call {
_c.Call.Return(run)
return _c
}
// CountSubjectCollections provides a mock function for the type CollectionsRepo
func (_mock *CollectionsRepo) CountSubjectCollections(ctx context.Context, userID model.UserID, subjectType model.SubjectType, collectionType collection.SubjectCollection, showPrivate bool) (int64, error) {
ret := _mock.Called(ctx, userID, subjectType, collectionType, showPrivate)
if len(ret) == 0 {
panic("no return value specified for CountSubjectCollections")
}
var r0 int64
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, model.SubjectType, collection.SubjectCollection, bool) (int64, error)); ok {
return returnFunc(ctx, userID, subjectType, collectionType, showPrivate)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, model.SubjectType, collection.SubjectCollection, bool) int64); ok {
r0 = returnFunc(ctx, userID, subjectType, collectionType, showPrivate)
} else {
r0 = ret.Get(0).(int64)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, model.UserID, model.SubjectType, collection.SubjectCollection, bool) error); ok {
r1 = returnFunc(ctx, userID, subjectType, collectionType, showPrivate)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionsRepo_CountSubjectCollections_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountSubjectCollections'
type CollectionsRepo_CountSubjectCollections_Call struct {
*mock.Call
}
// CountSubjectCollections is a helper method to define mock.On call
// - ctx context.Context
// - userID model.UserID
// - subjectType model.SubjectType
// - collectionType collection.SubjectCollection
// - showPrivate bool
func (_e *CollectionsRepo_Expecter) CountSubjectCollections(ctx interface{}, userID interface{}, subjectType interface{}, collectionType interface{}, showPrivate interface{}) *CollectionsRepo_CountSubjectCollections_Call {
return &CollectionsRepo_CountSubjectCollections_Call{Call: _e.mock.On("CountSubjectCollections", ctx, userID, subjectType, collectionType, showPrivate)}
}
func (_c *CollectionsRepo_CountSubjectCollections_Call) Run(run func(ctx context.Context, userID model.UserID, subjectType model.SubjectType, collectionType collection.SubjectCollection, showPrivate bool)) *CollectionsRepo_CountSubjectCollections_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 model.UserID
if args[1] != nil {
arg1 = args[1].(model.UserID)
}
var arg2 model.SubjectType
if args[2] != nil {
arg2 = args[2].(model.SubjectType)
}
var arg3 collection.SubjectCollection
if args[3] != nil {
arg3 = args[3].(collection.SubjectCollection)
}
var arg4 bool
if args[4] != nil {
arg4 = args[4].(bool)
}
run(
arg0,
arg1,
arg2,
arg3,
arg4,
)
})
return _c
}
func (_c *CollectionsRepo_CountSubjectCollections_Call) Return(n int64, err error) *CollectionsRepo_CountSubjectCollections_Call {
_c.Call.Return(n, err)
return _c
}
func (_c *CollectionsRepo_CountSubjectCollections_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID, subjectType model.SubjectType, collectionType collection.SubjectCollection, showPrivate bool) (int64, error)) *CollectionsRepo_CountSubjectCollections_Call {
_c.Call.Return(run)
return _c
}
// GetPersonCollection provides a mock function for the type CollectionsRepo
func (_mock *CollectionsRepo) GetPersonCollection(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory, targetID model.PersonID) (collection.UserPersonCollection, error) {
ret := _mock.Called(ctx, userID, cat, targetID)
if len(ret) == 0 {
panic("no return value specified for GetPersonCollection")
}
var r0 collection.UserPersonCollection
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, collection.PersonCollectCategory, model.PersonID) (collection.UserPersonCollection, error)); ok {
return returnFunc(ctx, userID, cat, targetID)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, collection.PersonCollectCategory, model.PersonID) collection.UserPersonCollection); ok {
r0 = returnFunc(ctx, userID, cat, targetID)
} else {
r0 = ret.Get(0).(collection.UserPersonCollection)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, model.UserID, collection.PersonCollectCategory, model.PersonID) error); ok {
r1 = returnFunc(ctx, userID, cat, targetID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionsRepo_GetPersonCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPersonCollection'
type CollectionsRepo_GetPersonCollection_Call struct {
*mock.Call
}
// GetPersonCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID model.UserID
// - cat collection.PersonCollectCategory
// - targetID model.PersonID
func (_e *CollectionsRepo_Expecter) GetPersonCollection(ctx interface{}, userID interface{}, cat interface{}, targetID interface{}) *CollectionsRepo_GetPersonCollection_Call {
return &CollectionsRepo_GetPersonCollection_Call{Call: _e.mock.On("GetPersonCollection", ctx, userID, cat, targetID)}
}
func (_c *CollectionsRepo_GetPersonCollection_Call) Run(run func(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory, targetID model.PersonID)) *CollectionsRepo_GetPersonCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 model.UserID
if args[1] != nil {
arg1 = args[1].(model.UserID)
}
var arg2 collection.PersonCollectCategory
if args[2] != nil {
arg2 = args[2].(collection.PersonCollectCategory)
}
var arg3 model.PersonID
if args[3] != nil {
arg3 = args[3].(model.PersonID)
}
run(
arg0,
arg1,
arg2,
arg3,
)
})
return _c
}
func (_c *CollectionsRepo_GetPersonCollection_Call) Return(userPersonCollection collection.UserPersonCollection, err error) *CollectionsRepo_GetPersonCollection_Call {
_c.Call.Return(userPersonCollection, err)
return _c
}
func (_c *CollectionsRepo_GetPersonCollection_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory, targetID model.PersonID) (collection.UserPersonCollection, error)) *CollectionsRepo_GetPersonCollection_Call {
_c.Call.Return(run)
return _c
}
// GetSubjectCollection provides a mock function for the type CollectionsRepo
func (_mock *CollectionsRepo) GetSubjectCollection(ctx context.Context, userID model.UserID, subjectID model.SubjectID) (collection.UserSubjectCollection, error) {
ret := _mock.Called(ctx, userID, subjectID)
if len(ret) == 0 {
panic("no return value specified for GetSubjectCollection")
}
var r0 collection.UserSubjectCollection
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, model.SubjectID) (collection.UserSubjectCollection, error)); ok {
return returnFunc(ctx, userID, subjectID)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, model.SubjectID) collection.UserSubjectCollection); ok {
r0 = returnFunc(ctx, userID, subjectID)
} else {
r0 = ret.Get(0).(collection.UserSubjectCollection)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, model.UserID, model.SubjectID) error); ok {
r1 = returnFunc(ctx, userID, subjectID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionsRepo_GetSubjectCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubjectCollection'
type CollectionsRepo_GetSubjectCollection_Call struct {
*mock.Call
}
// GetSubjectCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID model.UserID
// - subjectID model.SubjectID
func (_e *CollectionsRepo_Expecter) GetSubjectCollection(ctx interface{}, userID interface{}, subjectID interface{}) *CollectionsRepo_GetSubjectCollection_Call {
return &CollectionsRepo_GetSubjectCollection_Call{Call: _e.mock.On("GetSubjectCollection", ctx, userID, subjectID)}
}
func (_c *CollectionsRepo_GetSubjectCollection_Call) Run(run func(ctx context.Context, userID model.UserID, subjectID model.SubjectID)) *CollectionsRepo_GetSubjectCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 model.UserID
if args[1] != nil {
arg1 = args[1].(model.UserID)
}
var arg2 model.SubjectID
if args[2] != nil {
arg2 = args[2].(model.SubjectID)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *CollectionsRepo_GetSubjectCollection_Call) Return(userSubjectCollection collection.UserSubjectCollection, err error) *CollectionsRepo_GetSubjectCollection_Call {
_c.Call.Return(userSubjectCollection, err)
return _c
}
func (_c *CollectionsRepo_GetSubjectCollection_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID, subjectID model.SubjectID) (collection.UserSubjectCollection, error)) *CollectionsRepo_GetSubjectCollection_Call {
_c.Call.Return(run)
return _c
}
// GetSubjectEpisodesCollection provides a mock function for the type CollectionsRepo
func (_mock *CollectionsRepo) GetSubjectEpisodesCollection(ctx context.Context, userID model.UserID, subjectID model.SubjectID) (collection.UserSubjectEpisodesCollection, error) {
ret := _mock.Called(ctx, userID, subjectID)
if len(ret) == 0 {
panic("no return value specified for GetSubjectEpisodesCollection")
}
var r0 collection.UserSubjectEpisodesCollection
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, model.SubjectID) (collection.UserSubjectEpisodesCollection, error)); ok {
return returnFunc(ctx, userID, subjectID)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, model.SubjectID) collection.UserSubjectEpisodesCollection); ok {
r0 = returnFunc(ctx, userID, subjectID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(collection.UserSubjectEpisodesCollection)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, model.UserID, model.SubjectID) error); ok {
r1 = returnFunc(ctx, userID, subjectID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionsRepo_GetSubjectEpisodesCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubjectEpisodesCollection'
type CollectionsRepo_GetSubjectEpisodesCollection_Call struct {
*mock.Call
}
// GetSubjectEpisodesCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID model.UserID
// - subjectID model.SubjectID
func (_e *CollectionsRepo_Expecter) GetSubjectEpisodesCollection(ctx interface{}, userID interface{}, subjectID interface{}) *CollectionsRepo_GetSubjectEpisodesCollection_Call {
return &CollectionsRepo_GetSubjectEpisodesCollection_Call{Call: _e.mock.On("GetSubjectEpisodesCollection", ctx, userID, subjectID)}
}
func (_c *CollectionsRepo_GetSubjectEpisodesCollection_Call) Run(run func(ctx context.Context, userID model.UserID, subjectID model.SubjectID)) *CollectionsRepo_GetSubjectEpisodesCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 model.UserID
if args[1] != nil {
arg1 = args[1].(model.UserID)
}
var arg2 model.SubjectID
if args[2] != nil {
arg2 = args[2].(model.SubjectID)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *CollectionsRepo_GetSubjectEpisodesCollection_Call) Return(userSubjectEpisodesCollection collection.UserSubjectEpisodesCollection, err error) *CollectionsRepo_GetSubjectEpisodesCollection_Call {
_c.Call.Return(userSubjectEpisodesCollection, err)
return _c
}
func (_c *CollectionsRepo_GetSubjectEpisodesCollection_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID, subjectID model.SubjectID) (collection.UserSubjectEpisodesCollection, error)) *CollectionsRepo_GetSubjectEpisodesCollection_Call {
_c.Call.Return(run)
return _c
}
// ListPersonCollection provides a mock function for the type CollectionsRepo
func (_mock *CollectionsRepo) ListPersonCollection(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory, limit int, offset int) ([]collection.UserPersonCollection, error) {
ret := _mock.Called(ctx, userID, cat, limit, offset)
if len(ret) == 0 {
panic("no return value specified for ListPersonCollection")
}
var r0 []collection.UserPersonCollection
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, collection.PersonCollectCategory, int, int) ([]collection.UserPersonCollection, error)); ok {
return returnFunc(ctx, userID, cat, limit, offset)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, collection.PersonCollectCategory, int, int) []collection.UserPersonCollection); ok {
r0 = returnFunc(ctx, userID, cat, limit, offset)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]collection.UserPersonCollection)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, model.UserID, collection.PersonCollectCategory, int, int) error); ok {
r1 = returnFunc(ctx, userID, cat, limit, offset)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionsRepo_ListPersonCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPersonCollection'
type CollectionsRepo_ListPersonCollection_Call struct {
*mock.Call
}
// ListPersonCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID model.UserID
// - cat collection.PersonCollectCategory
// - limit int
// - offset int
func (_e *CollectionsRepo_Expecter) ListPersonCollection(ctx interface{}, userID interface{}, cat interface{}, limit interface{}, offset interface{}) *CollectionsRepo_ListPersonCollection_Call {
return &CollectionsRepo_ListPersonCollection_Call{Call: _e.mock.On("ListPersonCollection", ctx, userID, cat, limit, offset)}
}
func (_c *CollectionsRepo_ListPersonCollection_Call) Run(run func(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory, limit int, offset int)) *CollectionsRepo_ListPersonCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 model.UserID
if args[1] != nil {
arg1 = args[1].(model.UserID)
}
var arg2 collection.PersonCollectCategory
if args[2] != nil {
arg2 = args[2].(collection.PersonCollectCategory)
}
var arg3 int
if args[3] != nil {
arg3 = args[3].(int)
}
var arg4 int
if args[4] != nil {
arg4 = args[4].(int)
}
run(
arg0,
arg1,
arg2,
arg3,
arg4,
)
})
return _c
}
func (_c *CollectionsRepo_ListPersonCollection_Call) Return(userPersonCollections []collection.UserPersonCollection, err error) *CollectionsRepo_ListPersonCollection_Call {
_c.Call.Return(userPersonCollections, err)
return _c
}
func (_c *CollectionsRepo_ListPersonCollection_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory, limit int, offset int) ([]collection.UserPersonCollection, error)) *CollectionsRepo_ListPersonCollection_Call {
_c.Call.Return(run)
return _c
}
// ListSubjectCollection provides a mock function for the type CollectionsRepo
func (_mock *CollectionsRepo) ListSubjectCollection(ctx context.Context, userID model.UserID, subjectType model.SubjectType, collectionType collection.SubjectCollection, showPrivate bool, limit int, offset int) ([]collection.UserSubjectCollection, error) {
ret := _mock.Called(ctx, userID, subjectType, collectionType, showPrivate, limit, offset)
if len(ret) == 0 {
panic("no return value specified for ListSubjectCollection")
}
var r0 []collection.UserSubjectCollection
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, model.SubjectType, collection.SubjectCollection, bool, int, int) ([]collection.UserSubjectCollection, error)); ok {
return returnFunc(ctx, userID, subjectType, collectionType, showPrivate, limit, offset)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, model.SubjectType, collection.SubjectCollection, bool, int, int) []collection.UserSubjectCollection); ok {
r0 = returnFunc(ctx, userID, subjectType, collectionType, showPrivate, limit, offset)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]collection.UserSubjectCollection)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, model.UserID, model.SubjectType, collection.SubjectCollection, bool, int, int) error); ok {
r1 = returnFunc(ctx, userID, subjectType, collectionType, showPrivate, limit, offset)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionsRepo_ListSubjectCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSubjectCollection'
type CollectionsRepo_ListSubjectCollection_Call struct {
*mock.Call
}
// ListSubjectCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID model.UserID
// - subjectType model.SubjectType
// - collectionType collection.SubjectCollection
// - showPrivate bool
// - limit int
// - offset int
func (_e *CollectionsRepo_Expecter) ListSubjectCollection(ctx interface{}, userID interface{}, subjectType interface{}, collectionType interface{}, showPrivate interface{}, limit interface{}, offset interface{}) *CollectionsRepo_ListSubjectCollection_Call {
return &CollectionsRepo_ListSubjectCollection_Call{Call: _e.mock.On("ListSubjectCollection", ctx, userID, subjectType, collectionType, showPrivate, limit, offset)}
}
func (_c *CollectionsRepo_ListSubjectCollection_Call) Run(run func(ctx context.Context, userID model.UserID, subjectType model.SubjectType, collectionType collection.SubjectCollection, showPrivate bool, limit int, offset int)) *CollectionsRepo_ListSubjectCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 model.UserID
if args[1] != nil {
arg1 = args[1].(model.UserID)
}
var arg2 model.SubjectType
if args[2] != nil {
arg2 = args[2].(model.SubjectType)
}
var arg3 collection.SubjectCollection
if args[3] != nil {
arg3 = args[3].(collection.SubjectCollection)
}
var arg4 bool
if args[4] != nil {
arg4 = args[4].(bool)
}
var arg5 int
if args[5] != nil {
arg5 = args[5].(int)
}
var arg6 int
if args[6] != nil {
arg6 = args[6].(int)
}
run(
arg0,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6,
)
})
return _c
}
func (_c *CollectionsRepo_ListSubjectCollection_Call) Return(userSubjectCollections []collection.UserSubjectCollection, err error) *CollectionsRepo_ListSubjectCollection_Call {
_c.Call.Return(userSubjectCollections, err)
return _c
}
func (_c *CollectionsRepo_ListSubjectCollection_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID, subjectType model.SubjectType, collectionType collection.SubjectCollection, showPrivate bool, limit int, offset int) ([]collection.UserSubjectCollection, error)) *CollectionsRepo_ListSubjectCollection_Call {
_c.Call.Return(run)
return _c
}
// RemovePersonCollection provides a mock function for the type CollectionsRepo
func (_mock *CollectionsRepo) RemovePersonCollection(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory, targetID model.PersonID) error {
ret := _mock.Called(ctx, userID, cat, targetID)
if len(ret) == 0 {
panic("no return value specified for RemovePersonCollection")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, collection.PersonCollectCategory, model.PersonID) error); ok {
r0 = returnFunc(ctx, userID, cat, targetID)
} else {
r0 = ret.Error(0)
}
return r0
}
// CollectionsRepo_RemovePersonCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemovePersonCollection'
type CollectionsRepo_RemovePersonCollection_Call struct {
*mock.Call
}
// RemovePersonCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID model.UserID
// - cat collection.PersonCollectCategory
// - targetID model.PersonID
func (_e *CollectionsRepo_Expecter) RemovePersonCollection(ctx interface{}, userID interface{}, cat interface{}, targetID interface{}) *CollectionsRepo_RemovePersonCollection_Call {
return &CollectionsRepo_RemovePersonCollection_Call{Call: _e.mock.On("RemovePersonCollection", ctx, userID, cat, targetID)}
}
func (_c *CollectionsRepo_RemovePersonCollection_Call) Run(run func(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory, targetID model.PersonID)) *CollectionsRepo_RemovePersonCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 model.UserID
if args[1] != nil {
arg1 = args[1].(model.UserID)
}
var arg2 collection.PersonCollectCategory
if args[2] != nil {
arg2 = args[2].(collection.PersonCollectCategory)
}
var arg3 model.PersonID
if args[3] != nil {
arg3 = args[3].(model.PersonID)
}
run(
arg0,
arg1,
arg2,
arg3,
)
})
return _c
}
func (_c *CollectionsRepo_RemovePersonCollection_Call) Return(err error) *CollectionsRepo_RemovePersonCollection_Call {
_c.Call.Return(err)
return _c
}
func (_c *CollectionsRepo_RemovePersonCollection_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID, cat collection.PersonCollectCategory, targetID model.PersonID) error) *CollectionsRepo_RemovePersonCollection_Call {
_c.Call.Return(run)
return _c
}
// UpdateEpisodeCollection provides a mock function for the type CollectionsRepo
func (_mock *CollectionsRepo) UpdateEpisodeCollection(ctx context.Context, userID model.UserID, subjectID model.SubjectID, episodeIDs []model.EpisodeID, collection1 collection.EpisodeCollection, at time.Time) (collection.UserSubjectEpisodesCollection, error) {
ret := _mock.Called(ctx, userID, subjectID, episodeIDs, collection1, at)
if len(ret) == 0 {
panic("no return value specified for UpdateEpisodeCollection")
}
var r0 collection.UserSubjectEpisodesCollection
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, model.SubjectID, []model.EpisodeID, collection.EpisodeCollection, time.Time) (collection.UserSubjectEpisodesCollection, error)); ok {
return returnFunc(ctx, userID, subjectID, episodeIDs, collection1, at)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, model.SubjectID, []model.EpisodeID, collection.EpisodeCollection, time.Time) collection.UserSubjectEpisodesCollection); ok {
r0 = returnFunc(ctx, userID, subjectID, episodeIDs, collection1, at)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(collection.UserSubjectEpisodesCollection)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, model.UserID, model.SubjectID, []model.EpisodeID, collection.EpisodeCollection, time.Time) error); ok {
r1 = returnFunc(ctx, userID, subjectID, episodeIDs, collection1, at)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CollectionsRepo_UpdateEpisodeCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateEpisodeCollection'
type CollectionsRepo_UpdateEpisodeCollection_Call struct {
*mock.Call
}
// UpdateEpisodeCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID model.UserID
// - subjectID model.SubjectID
// - episodeIDs []model.EpisodeID
// - collection1 collection.EpisodeCollection
// - at time.Time
func (_e *CollectionsRepo_Expecter) UpdateEpisodeCollection(ctx interface{}, userID interface{}, subjectID interface{}, episodeIDs interface{}, collection1 interface{}, at interface{}) *CollectionsRepo_UpdateEpisodeCollection_Call {
return &CollectionsRepo_UpdateEpisodeCollection_Call{Call: _e.mock.On("UpdateEpisodeCollection", ctx, userID, subjectID, episodeIDs, collection1, at)}
}
func (_c *CollectionsRepo_UpdateEpisodeCollection_Call) Run(run func(ctx context.Context, userID model.UserID, subjectID model.SubjectID, episodeIDs []model.EpisodeID, collection1 collection.EpisodeCollection, at time.Time)) *CollectionsRepo_UpdateEpisodeCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 model.UserID
if args[1] != nil {
arg1 = args[1].(model.UserID)
}
var arg2 model.SubjectID
if args[2] != nil {
arg2 = args[2].(model.SubjectID)
}
var arg3 []model.EpisodeID
if args[3] != nil {
arg3 = args[3].([]model.EpisodeID)
}
var arg4 collection.EpisodeCollection
if args[4] != nil {
arg4 = args[4].(collection.EpisodeCollection)
}
var arg5 time.Time
if args[5] != nil {
arg5 = args[5].(time.Time)
}
run(
arg0,
arg1,
arg2,
arg3,
arg4,
arg5,
)
})
return _c
}
func (_c *CollectionsRepo_UpdateEpisodeCollection_Call) Return(userSubjectEpisodesCollection collection.UserSubjectEpisodesCollection, err error) *CollectionsRepo_UpdateEpisodeCollection_Call {
_c.Call.Return(userSubjectEpisodesCollection, err)
return _c
}
func (_c *CollectionsRepo_UpdateEpisodeCollection_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID, subjectID model.SubjectID, episodeIDs []model.EpisodeID, collection1 collection.EpisodeCollection, at time.Time) (collection.UserSubjectEpisodesCollection, error)) *CollectionsRepo_UpdateEpisodeCollection_Call {
_c.Call.Return(run)
return _c
}
// UpdateOrCreateSubjectCollection provides a mock function for the type CollectionsRepo
func (_mock *CollectionsRepo) UpdateOrCreateSubjectCollection(ctx context.Context, userID model.UserID, subject model.Subject, at time.Time, ip string, update func(ctx context.Context, s *collection.Subject) (*collection.Subject, error)) error {
ret := _mock.Called(ctx, userID, subject, at, ip, update)
if len(ret) == 0 {
panic("no return value specified for UpdateOrCreateSubjectCollection")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, model.Subject, time.Time, string, func(ctx context.Context, s *collection.Subject) (*collection.Subject, error)) error); ok {
r0 = returnFunc(ctx, userID, subject, at, ip, update)
} else {
r0 = ret.Error(0)
}
return r0
}
// CollectionsRepo_UpdateOrCreateSubjectCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateOrCreateSubjectCollection'
type CollectionsRepo_UpdateOrCreateSubjectCollection_Call struct {
*mock.Call
}
// UpdateOrCreateSubjectCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID model.UserID
// - subject model.Subject
// - at time.Time
// - ip string
// - update func(ctx context.Context, s *collection.Subject) (*collection.Subject, error)
func (_e *CollectionsRepo_Expecter) UpdateOrCreateSubjectCollection(ctx interface{}, userID interface{}, subject interface{}, at interface{}, ip interface{}, update interface{}) *CollectionsRepo_UpdateOrCreateSubjectCollection_Call {
return &CollectionsRepo_UpdateOrCreateSubjectCollection_Call{Call: _e.mock.On("UpdateOrCreateSubjectCollection", ctx, userID, subject, at, ip, update)}
}
func (_c *CollectionsRepo_UpdateOrCreateSubjectCollection_Call) Run(run func(ctx context.Context, userID model.UserID, subject model.Subject, at time.Time, ip string, update func(ctx context.Context, s *collection.Subject) (*collection.Subject, error))) *CollectionsRepo_UpdateOrCreateSubjectCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 model.UserID
if args[1] != nil {
arg1 = args[1].(model.UserID)
}
var arg2 model.Subject
if args[2] != nil {
arg2 = args[2].(model.Subject)
}
var arg3 time.Time
if args[3] != nil {
arg3 = args[3].(time.Time)
}
var arg4 string
if args[4] != nil {
arg4 = args[4].(string)
}
var arg5 func(ctx context.Context, s *collection.Subject) (*collection.Subject, error)
if args[5] != nil {
arg5 = args[5].(func(ctx context.Context, s *collection.Subject) (*collection.Subject, error))
}
run(
arg0,
arg1,
arg2,
arg3,
arg4,
arg5,
)
})
return _c
}
func (_c *CollectionsRepo_UpdateOrCreateSubjectCollection_Call) Return(err error) *CollectionsRepo_UpdateOrCreateSubjectCollection_Call {
_c.Call.Return(err)
return _c
}
func (_c *CollectionsRepo_UpdateOrCreateSubjectCollection_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID, subject model.Subject, at time.Time, ip string, update func(ctx context.Context, s *collection.Subject) (*collection.Subject, error)) error) *CollectionsRepo_UpdateOrCreateSubjectCollection_Call {
_c.Call.Return(run)
return _c
}
// UpdateSubjectCollection provides a mock function for the type CollectionsRepo
func (_mock *CollectionsRepo) UpdateSubjectCollection(ctx context.Context, userID model.UserID, subject model.Subject, at time.Time, ip string, update func(ctx context.Context, s *collection.Subject) (*collection.Subject, error)) error {
ret := _mock.Called(ctx, userID, subject, at, ip, update)
if len(ret) == 0 {
panic("no return value specified for UpdateSubjectCollection")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, model.Subject, time.Time, string, func(ctx context.Context, s *collection.Subject) (*collection.Subject, error)) error); ok {
r0 = returnFunc(ctx, userID, subject, at, ip, update)
} else {
r0 = ret.Error(0)
}
return r0
}
// CollectionsRepo_UpdateSubjectCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSubjectCollection'
type CollectionsRepo_UpdateSubjectCollection_Call struct {
*mock.Call
}
// UpdateSubjectCollection is a helper method to define mock.On call
// - ctx context.Context
// - userID model.UserID
// - subject model.Subject
// - at time.Time
// - ip string
// - update func(ctx context.Context, s *collection.Subject) (*collection.Subject, error)
func (_e *CollectionsRepo_Expecter) UpdateSubjectCollection(ctx interface{}, userID interface{}, subject interface{}, at interface{}, ip interface{}, update interface{}) *CollectionsRepo_UpdateSubjectCollection_Call {
return &CollectionsRepo_UpdateSubjectCollection_Call{Call: _e.mock.On("UpdateSubjectCollection", ctx, userID, subject, at, ip, update)}
}
func (_c *CollectionsRepo_UpdateSubjectCollection_Call) Run(run func(ctx context.Context, userID model.UserID, subject model.Subject, at time.Time, ip string, update func(ctx context.Context, s *collection.Subject) (*collection.Subject, error))) *CollectionsRepo_UpdateSubjectCollection_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 model.UserID
if args[1] != nil {
arg1 = args[1].(model.UserID)
}
var arg2 model.Subject
if args[2] != nil {
arg2 = args[2].(model.Subject)
}
var arg3 time.Time
if args[3] != nil {
arg3 = args[3].(time.Time)
}
var arg4 string
if args[4] != nil {
arg4 = args[4].(string)
}
var arg5 func(ctx context.Context, s *collection.Subject) (*collection.Subject, error)
if args[5] != nil {
arg5 = args[5].(func(ctx context.Context, s *collection.Subject) (*collection.Subject, error))
}
run(
arg0,
arg1,
arg2,
arg3,
arg4,
arg5,
)
})
return _c
}
func (_c *CollectionsRepo_UpdateSubjectCollection_Call) Return(err error) *CollectionsRepo_UpdateSubjectCollection_Call {
_c.Call.Return(err)
return _c
}
func (_c *CollectionsRepo_UpdateSubjectCollection_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID, subject model.Subject, at time.Time, ip string, update func(ctx context.Context, s *collection.Subject) (*collection.Subject, error)) error) *CollectionsRepo_UpdateSubjectCollection_Call {
_c.Call.Return(run)
return _c
}