-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
service_mock.go
2277 lines (2153 loc) · 64.3 KB
/
service_mock.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
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 moq; DO NOT EDIT.
// github.com/matryer/moq
package transport
import (
"context"
"github.com/SherClockHolmes/webpush-go"
"github.com/nakamauwu/nakama"
"io"
"net/url"
"sync"
)
// Ensure, that ServiceMock does implement Service.
// If this is not the case, regenerate this file with moq.
var _ Service = &ServiceMock{}
// ServiceMock is a mock implementation of Service.
//
// func TestSomethingThatUsesService(t *testing.T) {
//
// // make and configure a mocked Service
// mockedService := &ServiceMock{
// AddWebPushSubscriptionFunc: func(ctx context.Context, sub webpush.Subscription) error {
// panic("mock out the AddWebPushSubscription method")
// },
// AuthUserFunc: func(ctx context.Context) (nakama.User, error) {
// panic("mock out the AuthUser method")
// },
// AuthUserIDFromTokenFunc: func(token string) (string, error) {
// panic("mock out the AuthUserIDFromToken method")
// },
// CommentStreamFunc: func(ctx context.Context, postID string) (<-chan nakama.Comment, error) {
// panic("mock out the CommentStream method")
// },
// CommentsFunc: func(ctx context.Context, postID string, last uint64, before *string) (nakama.Comments, error) {
// panic("mock out the Comments method")
// },
// CreateCommentFunc: func(ctx context.Context, postID string, content string) (nakama.Comment, error) {
// panic("mock out the CreateComment method")
// },
// CreateTimelineItemFunc: func(ctx context.Context, content string, spoilerOf *string, nsfw bool, media []io.ReadSeeker) (nakama.TimelineItem, error) {
// panic("mock out the CreateTimelineItem method")
// },
// DeleteCommentFunc: func(ctx context.Context, commentID string) error {
// panic("mock out the DeleteComment method")
// },
// DeletePostFunc: func(ctx context.Context, postID string) error {
// panic("mock out the DeletePost method")
// },
// DeleteTimelineItemFunc: func(ctx context.Context, timelineItemID string) error {
// panic("mock out the DeleteTimelineItem method")
// },
// DevLoginFunc: func(ctx context.Context, email string) (nakama.AuthOutput, error) {
// panic("mock out the DevLogin method")
// },
// FolloweesFunc: func(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error) {
// panic("mock out the Followees method")
// },
// FollowersFunc: func(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error) {
// panic("mock out the Followers method")
// },
// HasUnreadNotificationsFunc: func(ctx context.Context) (bool, error) {
// panic("mock out the HasUnreadNotifications method")
// },
// LoginFromProviderFunc: func(ctx context.Context, name string, user nakama.ProvidedUser) (nakama.User, error) {
// panic("mock out the LoginFromProvider method")
// },
// MarkNotificationAsReadFunc: func(ctx context.Context, notificationID string) error {
// panic("mock out the MarkNotificationAsRead method")
// },
// MarkNotificationsAsReadFunc: func(ctx context.Context) error {
// panic("mock out the MarkNotificationsAsRead method")
// },
// NotificationStreamFunc: func(ctx context.Context) (<-chan nakama.Notification, error) {
// panic("mock out the NotificationStream method")
// },
// NotificationsFunc: func(ctx context.Context, last uint64, before *string) (nakama.Notifications, error) {
// panic("mock out the Notifications method")
// },
// ParseRedirectURIFunc: func(rawurl string) (*url.URL, error) {
// panic("mock out the ParseRedirectURI method")
// },
// PostFunc: func(ctx context.Context, postID string) (nakama.Post, error) {
// panic("mock out the Post method")
// },
// PostStreamFunc: func(ctx context.Context) (<-chan nakama.Post, error) {
// panic("mock out the PostStream method")
// },
// PostsFunc: func(ctx context.Context, last uint64, before *string, opts ...nakama.PostsOpt) (nakama.Posts, error) {
// panic("mock out the Posts method")
// },
// SendMagicLinkFunc: func(ctx context.Context, in nakama.SendMagicLink) error {
// panic("mock out the SendMagicLink method")
// },
// TimelineFunc: func(ctx context.Context, last uint64, before *string) (nakama.Timeline, error) {
// panic("mock out the Timeline method")
// },
// TimelineItemStreamFunc: func(ctx context.Context) (<-chan nakama.TimelineItem, error) {
// panic("mock out the TimelineItemStream method")
// },
// ToggleCommentReactionFunc: func(ctx context.Context, commentID string, in nakama.ReactionInput) ([]nakama.Reaction, error) {
// panic("mock out the ToggleCommentReaction method")
// },
// ToggleFollowFunc: func(ctx context.Context, username string) (nakama.ToggleFollowOutput, error) {
// panic("mock out the ToggleFollow method")
// },
// TogglePostReactionFunc: func(ctx context.Context, postID string, in nakama.ReactionInput) ([]nakama.Reaction, error) {
// panic("mock out the TogglePostReaction method")
// },
// TogglePostSubscriptionFunc: func(ctx context.Context, postID string) (nakama.ToggleSubscriptionOutput, error) {
// panic("mock out the TogglePostSubscription method")
// },
// TokenFunc: func(ctx context.Context) (nakama.TokenOutput, error) {
// panic("mock out the Token method")
// },
// UpdateAvatarFunc: func(ctx context.Context, r io.ReadSeeker) (string, error) {
// panic("mock out the UpdateAvatar method")
// },
// UpdateCommentFunc: func(ctx context.Context, in nakama.UpdateComment) (nakama.UpdatedComment, error) {
// panic("mock out the UpdateComment method")
// },
// UpdateCoverFunc: func(ctx context.Context, r io.ReadSeeker) (string, error) {
// panic("mock out the UpdateCover method")
// },
// UpdatePostFunc: func(ctx context.Context, postID string, in nakama.UpdatePost) (nakama.UpdatedPost, error) {
// panic("mock out the UpdatePost method")
// },
// UpdateUserFunc: func(ctx context.Context, params nakama.UpdateUserParams) error {
// panic("mock out the UpdateUser method")
// },
// UserFunc: func(ctx context.Context, username string) (nakama.UserProfile, error) {
// panic("mock out the User method")
// },
// UsernamesFunc: func(ctx context.Context, startingWith string, first uint64, after *string) (nakama.Usernames, error) {
// panic("mock out the Usernames method")
// },
// UsersFunc: func(ctx context.Context, search string, first uint64, after *string) (nakama.UserProfiles, error) {
// panic("mock out the Users method")
// },
// VerifyMagicLinkFunc: func(ctx context.Context, email string, code string, username *string) (nakama.AuthOutput, error) {
// panic("mock out the VerifyMagicLink method")
// },
// }
//
// // use mockedService in code that requires Service
// // and then make assertions.
//
// }
type ServiceMock struct {
// AddWebPushSubscriptionFunc mocks the AddWebPushSubscription method.
AddWebPushSubscriptionFunc func(ctx context.Context, sub webpush.Subscription) error
// AuthUserFunc mocks the AuthUser method.
AuthUserFunc func(ctx context.Context) (nakama.User, error)
// AuthUserIDFromTokenFunc mocks the AuthUserIDFromToken method.
AuthUserIDFromTokenFunc func(token string) (string, error)
// CommentStreamFunc mocks the CommentStream method.
CommentStreamFunc func(ctx context.Context, postID string) (<-chan nakama.Comment, error)
// CommentsFunc mocks the Comments method.
CommentsFunc func(ctx context.Context, postID string, last uint64, before *string) (nakama.Comments, error)
// CreateCommentFunc mocks the CreateComment method.
CreateCommentFunc func(ctx context.Context, postID string, content string) (nakama.Comment, error)
// CreateTimelineItemFunc mocks the CreateTimelineItem method.
CreateTimelineItemFunc func(ctx context.Context, content string, spoilerOf *string, nsfw bool, media []io.ReadSeeker) (nakama.TimelineItem, error)
// DeleteCommentFunc mocks the DeleteComment method.
DeleteCommentFunc func(ctx context.Context, commentID string) error
// DeletePostFunc mocks the DeletePost method.
DeletePostFunc func(ctx context.Context, postID string) error
// DeleteTimelineItemFunc mocks the DeleteTimelineItem method.
DeleteTimelineItemFunc func(ctx context.Context, timelineItemID string) error
// DevLoginFunc mocks the DevLogin method.
DevLoginFunc func(ctx context.Context, email string) (nakama.AuthOutput, error)
// FolloweesFunc mocks the Followees method.
FolloweesFunc func(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error)
// FollowersFunc mocks the Followers method.
FollowersFunc func(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error)
// HasUnreadNotificationsFunc mocks the HasUnreadNotifications method.
HasUnreadNotificationsFunc func(ctx context.Context) (bool, error)
// LoginFromProviderFunc mocks the LoginFromProvider method.
LoginFromProviderFunc func(ctx context.Context, name string, user nakama.ProvidedUser) (nakama.User, error)
// MarkNotificationAsReadFunc mocks the MarkNotificationAsRead method.
MarkNotificationAsReadFunc func(ctx context.Context, notificationID string) error
// MarkNotificationsAsReadFunc mocks the MarkNotificationsAsRead method.
MarkNotificationsAsReadFunc func(ctx context.Context) error
// NotificationStreamFunc mocks the NotificationStream method.
NotificationStreamFunc func(ctx context.Context) (<-chan nakama.Notification, error)
// NotificationsFunc mocks the Notifications method.
NotificationsFunc func(ctx context.Context, last uint64, before *string) (nakama.Notifications, error)
// ParseRedirectURIFunc mocks the ParseRedirectURI method.
ParseRedirectURIFunc func(rawurl string) (*url.URL, error)
// PostFunc mocks the Post method.
PostFunc func(ctx context.Context, postID string) (nakama.Post, error)
// PostStreamFunc mocks the PostStream method.
PostStreamFunc func(ctx context.Context) (<-chan nakama.Post, error)
// PostsFunc mocks the Posts method.
PostsFunc func(ctx context.Context, last uint64, before *string, opts ...nakama.PostsOpt) (nakama.Posts, error)
// SendMagicLinkFunc mocks the SendMagicLink method.
SendMagicLinkFunc func(ctx context.Context, in nakama.SendMagicLink) error
// TimelineFunc mocks the Timeline method.
TimelineFunc func(ctx context.Context, last uint64, before *string) (nakama.Timeline, error)
// TimelineItemStreamFunc mocks the TimelineItemStream method.
TimelineItemStreamFunc func(ctx context.Context) (<-chan nakama.TimelineItem, error)
// ToggleCommentReactionFunc mocks the ToggleCommentReaction method.
ToggleCommentReactionFunc func(ctx context.Context, commentID string, in nakama.ReactionInput) ([]nakama.Reaction, error)
// ToggleFollowFunc mocks the ToggleFollow method.
ToggleFollowFunc func(ctx context.Context, username string) (nakama.ToggleFollowOutput, error)
// TogglePostReactionFunc mocks the TogglePostReaction method.
TogglePostReactionFunc func(ctx context.Context, postID string, in nakama.ReactionInput) ([]nakama.Reaction, error)
// TogglePostSubscriptionFunc mocks the TogglePostSubscription method.
TogglePostSubscriptionFunc func(ctx context.Context, postID string) (nakama.ToggleSubscriptionOutput, error)
// TokenFunc mocks the Token method.
TokenFunc func(ctx context.Context) (nakama.TokenOutput, error)
// UpdateAvatarFunc mocks the UpdateAvatar method.
UpdateAvatarFunc func(ctx context.Context, r io.ReadSeeker) (string, error)
// UpdateCommentFunc mocks the UpdateComment method.
UpdateCommentFunc func(ctx context.Context, in nakama.UpdateComment) (nakama.UpdatedComment, error)
// UpdateCoverFunc mocks the UpdateCover method.
UpdateCoverFunc func(ctx context.Context, r io.ReadSeeker) (string, error)
// UpdatePostFunc mocks the UpdatePost method.
UpdatePostFunc func(ctx context.Context, postID string, in nakama.UpdatePost) (nakama.UpdatedPost, error)
// UpdateUserFunc mocks the UpdateUser method.
UpdateUserFunc func(ctx context.Context, params nakama.UpdateUserParams) error
// UserFunc mocks the User method.
UserFunc func(ctx context.Context, username string) (nakama.UserProfile, error)
// UsernamesFunc mocks the Usernames method.
UsernamesFunc func(ctx context.Context, startingWith string, first uint64, after *string) (nakama.Usernames, error)
// UsersFunc mocks the Users method.
UsersFunc func(ctx context.Context, search string, first uint64, after *string) (nakama.UserProfiles, error)
// VerifyMagicLinkFunc mocks the VerifyMagicLink method.
VerifyMagicLinkFunc func(ctx context.Context, email string, code string, username *string) (nakama.AuthOutput, error)
// calls tracks calls to the methods.
calls struct {
// AddWebPushSubscription holds details about calls to the AddWebPushSubscription method.
AddWebPushSubscription []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Sub is the sub argument value.
Sub webpush.Subscription
}
// AuthUser holds details about calls to the AuthUser method.
AuthUser []struct {
// Ctx is the ctx argument value.
Ctx context.Context
}
// AuthUserIDFromToken holds details about calls to the AuthUserIDFromToken method.
AuthUserIDFromToken []struct {
// Token is the token argument value.
Token string
}
// CommentStream holds details about calls to the CommentStream method.
CommentStream []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// PostID is the postID argument value.
PostID string
}
// Comments holds details about calls to the Comments method.
Comments []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// PostID is the postID argument value.
PostID string
// Last is the last argument value.
Last uint64
// Before is the before argument value.
Before *string
}
// CreateComment holds details about calls to the CreateComment method.
CreateComment []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// PostID is the postID argument value.
PostID string
// Content is the content argument value.
Content string
}
// CreateTimelineItem holds details about calls to the CreateTimelineItem method.
CreateTimelineItem []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Content is the content argument value.
Content string
// SpoilerOf is the spoilerOf argument value.
SpoilerOf *string
// Nsfw is the nsfw argument value.
Nsfw bool
// Media is the media argument value.
Media []io.ReadSeeker
}
// DeleteComment holds details about calls to the DeleteComment method.
DeleteComment []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// CommentID is the commentID argument value.
CommentID string
}
// DeletePost holds details about calls to the DeletePost method.
DeletePost []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// PostID is the postID argument value.
PostID string
}
// DeleteTimelineItem holds details about calls to the DeleteTimelineItem method.
DeleteTimelineItem []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// TimelineItemID is the timelineItemID argument value.
TimelineItemID string
}
// DevLogin holds details about calls to the DevLogin method.
DevLogin []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Email is the email argument value.
Email string
}
// Followees holds details about calls to the Followees method.
Followees []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Username is the username argument value.
Username string
// First is the first argument value.
First uint64
// After is the after argument value.
After *string
}
// Followers holds details about calls to the Followers method.
Followers []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Username is the username argument value.
Username string
// First is the first argument value.
First uint64
// After is the after argument value.
After *string
}
// HasUnreadNotifications holds details about calls to the HasUnreadNotifications method.
HasUnreadNotifications []struct {
// Ctx is the ctx argument value.
Ctx context.Context
}
// LoginFromProvider holds details about calls to the LoginFromProvider method.
LoginFromProvider []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Name is the name argument value.
Name string
// User is the user argument value.
User nakama.ProvidedUser
}
// MarkNotificationAsRead holds details about calls to the MarkNotificationAsRead method.
MarkNotificationAsRead []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// NotificationID is the notificationID argument value.
NotificationID string
}
// MarkNotificationsAsRead holds details about calls to the MarkNotificationsAsRead method.
MarkNotificationsAsRead []struct {
// Ctx is the ctx argument value.
Ctx context.Context
}
// NotificationStream holds details about calls to the NotificationStream method.
NotificationStream []struct {
// Ctx is the ctx argument value.
Ctx context.Context
}
// Notifications holds details about calls to the Notifications method.
Notifications []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Last is the last argument value.
Last uint64
// Before is the before argument value.
Before *string
}
// ParseRedirectURI holds details about calls to the ParseRedirectURI method.
ParseRedirectURI []struct {
// Rawurl is the rawurl argument value.
Rawurl string
}
// Post holds details about calls to the Post method.
Post []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// PostID is the postID argument value.
PostID string
}
// PostStream holds details about calls to the PostStream method.
PostStream []struct {
// Ctx is the ctx argument value.
Ctx context.Context
}
// Posts holds details about calls to the Posts method.
Posts []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Last is the last argument value.
Last uint64
// Before is the before argument value.
Before *string
// Opts is the opts argument value.
Opts []nakama.PostsOpt
}
// SendMagicLink holds details about calls to the SendMagicLink method.
SendMagicLink []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In nakama.SendMagicLink
}
// Timeline holds details about calls to the Timeline method.
Timeline []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Last is the last argument value.
Last uint64
// Before is the before argument value.
Before *string
}
// TimelineItemStream holds details about calls to the TimelineItemStream method.
TimelineItemStream []struct {
// Ctx is the ctx argument value.
Ctx context.Context
}
// ToggleCommentReaction holds details about calls to the ToggleCommentReaction method.
ToggleCommentReaction []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// CommentID is the commentID argument value.
CommentID string
// In is the in argument value.
In nakama.ReactionInput
}
// ToggleFollow holds details about calls to the ToggleFollow method.
ToggleFollow []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Username is the username argument value.
Username string
}
// TogglePostReaction holds details about calls to the TogglePostReaction method.
TogglePostReaction []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// PostID is the postID argument value.
PostID string
// In is the in argument value.
In nakama.ReactionInput
}
// TogglePostSubscription holds details about calls to the TogglePostSubscription method.
TogglePostSubscription []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// PostID is the postID argument value.
PostID string
}
// Token holds details about calls to the Token method.
Token []struct {
// Ctx is the ctx argument value.
Ctx context.Context
}
// UpdateAvatar holds details about calls to the UpdateAvatar method.
UpdateAvatar []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// R is the r argument value.
R io.ReadSeeker
}
// UpdateComment holds details about calls to the UpdateComment method.
UpdateComment []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In nakama.UpdateComment
}
// UpdateCover holds details about calls to the UpdateCover method.
UpdateCover []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// R is the r argument value.
R io.ReadSeeker
}
// UpdatePost holds details about calls to the UpdatePost method.
UpdatePost []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// PostID is the postID argument value.
PostID string
// In is the in argument value.
In nakama.UpdatePost
}
// UpdateUser holds details about calls to the UpdateUser method.
UpdateUser []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Params is the params argument value.
Params nakama.UpdateUserParams
}
// User holds details about calls to the User method.
User []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Username is the username argument value.
Username string
}
// Usernames holds details about calls to the Usernames method.
Usernames []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// StartingWith is the startingWith argument value.
StartingWith string
// First is the first argument value.
First uint64
// After is the after argument value.
After *string
}
// Users holds details about calls to the Users method.
Users []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Search is the search argument value.
Search string
// First is the first argument value.
First uint64
// After is the after argument value.
After *string
}
// VerifyMagicLink holds details about calls to the VerifyMagicLink method.
VerifyMagicLink []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Email is the email argument value.
Email string
// Code is the code argument value.
Code string
// Username is the username argument value.
Username *string
}
}
lockAddWebPushSubscription sync.RWMutex
lockAuthUser sync.RWMutex
lockAuthUserIDFromToken sync.RWMutex
lockCommentStream sync.RWMutex
lockComments sync.RWMutex
lockCreateComment sync.RWMutex
lockCreateTimelineItem sync.RWMutex
lockDeleteComment sync.RWMutex
lockDeletePost sync.RWMutex
lockDeleteTimelineItem sync.RWMutex
lockDevLogin sync.RWMutex
lockFollowees sync.RWMutex
lockFollowers sync.RWMutex
lockHasUnreadNotifications sync.RWMutex
lockLoginFromProvider sync.RWMutex
lockMarkNotificationAsRead sync.RWMutex
lockMarkNotificationsAsRead sync.RWMutex
lockNotificationStream sync.RWMutex
lockNotifications sync.RWMutex
lockParseRedirectURI sync.RWMutex
lockPost sync.RWMutex
lockPostStream sync.RWMutex
lockPosts sync.RWMutex
lockSendMagicLink sync.RWMutex
lockTimeline sync.RWMutex
lockTimelineItemStream sync.RWMutex
lockToggleCommentReaction sync.RWMutex
lockToggleFollow sync.RWMutex
lockTogglePostReaction sync.RWMutex
lockTogglePostSubscription sync.RWMutex
lockToken sync.RWMutex
lockUpdateAvatar sync.RWMutex
lockUpdateComment sync.RWMutex
lockUpdateCover sync.RWMutex
lockUpdatePost sync.RWMutex
lockUpdateUser sync.RWMutex
lockUser sync.RWMutex
lockUsernames sync.RWMutex
lockUsers sync.RWMutex
lockVerifyMagicLink sync.RWMutex
}
// AddWebPushSubscription calls AddWebPushSubscriptionFunc.
func (mock *ServiceMock) AddWebPushSubscription(ctx context.Context, sub webpush.Subscription) error {
callInfo := struct {
Ctx context.Context
Sub webpush.Subscription
}{
Ctx: ctx,
Sub: sub,
}
mock.lockAddWebPushSubscription.Lock()
mock.calls.AddWebPushSubscription = append(mock.calls.AddWebPushSubscription, callInfo)
mock.lockAddWebPushSubscription.Unlock()
if mock.AddWebPushSubscriptionFunc == nil {
var (
errOut error
)
return errOut
}
return mock.AddWebPushSubscriptionFunc(ctx, sub)
}
// AddWebPushSubscriptionCalls gets all the calls that were made to AddWebPushSubscription.
// Check the length with:
//
// len(mockedService.AddWebPushSubscriptionCalls())
func (mock *ServiceMock) AddWebPushSubscriptionCalls() []struct {
Ctx context.Context
Sub webpush.Subscription
} {
var calls []struct {
Ctx context.Context
Sub webpush.Subscription
}
mock.lockAddWebPushSubscription.RLock()
calls = mock.calls.AddWebPushSubscription
mock.lockAddWebPushSubscription.RUnlock()
return calls
}
// AuthUser calls AuthUserFunc.
func (mock *ServiceMock) AuthUser(ctx context.Context) (nakama.User, error) {
callInfo := struct {
Ctx context.Context
}{
Ctx: ctx,
}
mock.lockAuthUser.Lock()
mock.calls.AuthUser = append(mock.calls.AuthUser, callInfo)
mock.lockAuthUser.Unlock()
if mock.AuthUserFunc == nil {
var (
userOut nakama.User
errOut error
)
return userOut, errOut
}
return mock.AuthUserFunc(ctx)
}
// AuthUserCalls gets all the calls that were made to AuthUser.
// Check the length with:
//
// len(mockedService.AuthUserCalls())
func (mock *ServiceMock) AuthUserCalls() []struct {
Ctx context.Context
} {
var calls []struct {
Ctx context.Context
}
mock.lockAuthUser.RLock()
calls = mock.calls.AuthUser
mock.lockAuthUser.RUnlock()
return calls
}
// AuthUserIDFromToken calls AuthUserIDFromTokenFunc.
func (mock *ServiceMock) AuthUserIDFromToken(token string) (string, error) {
callInfo := struct {
Token string
}{
Token: token,
}
mock.lockAuthUserIDFromToken.Lock()
mock.calls.AuthUserIDFromToken = append(mock.calls.AuthUserIDFromToken, callInfo)
mock.lockAuthUserIDFromToken.Unlock()
if mock.AuthUserIDFromTokenFunc == nil {
var (
sOut string
errOut error
)
return sOut, errOut
}
return mock.AuthUserIDFromTokenFunc(token)
}
// AuthUserIDFromTokenCalls gets all the calls that were made to AuthUserIDFromToken.
// Check the length with:
//
// len(mockedService.AuthUserIDFromTokenCalls())
func (mock *ServiceMock) AuthUserIDFromTokenCalls() []struct {
Token string
} {
var calls []struct {
Token string
}
mock.lockAuthUserIDFromToken.RLock()
calls = mock.calls.AuthUserIDFromToken
mock.lockAuthUserIDFromToken.RUnlock()
return calls
}
// CommentStream calls CommentStreamFunc.
func (mock *ServiceMock) CommentStream(ctx context.Context, postID string) (<-chan nakama.Comment, error) {
callInfo := struct {
Ctx context.Context
PostID string
}{
Ctx: ctx,
PostID: postID,
}
mock.lockCommentStream.Lock()
mock.calls.CommentStream = append(mock.calls.CommentStream, callInfo)
mock.lockCommentStream.Unlock()
if mock.CommentStreamFunc == nil {
var (
commentChOut <-chan nakama.Comment
errOut error
)
return commentChOut, errOut
}
return mock.CommentStreamFunc(ctx, postID)
}
// CommentStreamCalls gets all the calls that were made to CommentStream.
// Check the length with:
//
// len(mockedService.CommentStreamCalls())
func (mock *ServiceMock) CommentStreamCalls() []struct {
Ctx context.Context
PostID string
} {
var calls []struct {
Ctx context.Context
PostID string
}
mock.lockCommentStream.RLock()
calls = mock.calls.CommentStream
mock.lockCommentStream.RUnlock()
return calls
}
// Comments calls CommentsFunc.
func (mock *ServiceMock) Comments(ctx context.Context, postID string, last uint64, before *string) (nakama.Comments, error) {
callInfo := struct {
Ctx context.Context
PostID string
Last uint64
Before *string
}{
Ctx: ctx,
PostID: postID,
Last: last,
Before: before,
}
mock.lockComments.Lock()
mock.calls.Comments = append(mock.calls.Comments, callInfo)
mock.lockComments.Unlock()
if mock.CommentsFunc == nil {
var (
commentsOut nakama.Comments
errOut error
)
return commentsOut, errOut
}
return mock.CommentsFunc(ctx, postID, last, before)
}
// CommentsCalls gets all the calls that were made to Comments.
// Check the length with:
//
// len(mockedService.CommentsCalls())
func (mock *ServiceMock) CommentsCalls() []struct {
Ctx context.Context
PostID string
Last uint64
Before *string
} {
var calls []struct {
Ctx context.Context
PostID string
Last uint64
Before *string
}
mock.lockComments.RLock()
calls = mock.calls.Comments
mock.lockComments.RUnlock()
return calls
}
// CreateComment calls CreateCommentFunc.
func (mock *ServiceMock) CreateComment(ctx context.Context, postID string, content string) (nakama.Comment, error) {
callInfo := struct {
Ctx context.Context
PostID string
Content string
}{
Ctx: ctx,
PostID: postID,
Content: content,
}
mock.lockCreateComment.Lock()
mock.calls.CreateComment = append(mock.calls.CreateComment, callInfo)
mock.lockCreateComment.Unlock()
if mock.CreateCommentFunc == nil {
var (
commentOut nakama.Comment
errOut error
)
return commentOut, errOut
}
return mock.CreateCommentFunc(ctx, postID, content)
}
// CreateCommentCalls gets all the calls that were made to CreateComment.
// Check the length with:
//
// len(mockedService.CreateCommentCalls())
func (mock *ServiceMock) CreateCommentCalls() []struct {
Ctx context.Context
PostID string
Content string
} {
var calls []struct {
Ctx context.Context
PostID string
Content string
}
mock.lockCreateComment.RLock()
calls = mock.calls.CreateComment
mock.lockCreateComment.RUnlock()
return calls
}
// CreateTimelineItem calls CreateTimelineItemFunc.
func (mock *ServiceMock) CreateTimelineItem(ctx context.Context, content string, spoilerOf *string, nsfw bool, media []io.ReadSeeker) (nakama.TimelineItem, error) {
callInfo := struct {
Ctx context.Context
Content string
SpoilerOf *string
Nsfw bool
Media []io.ReadSeeker
}{
Ctx: ctx,
Content: content,
SpoilerOf: spoilerOf,
Nsfw: nsfw,
Media: media,
}
mock.lockCreateTimelineItem.Lock()
mock.calls.CreateTimelineItem = append(mock.calls.CreateTimelineItem, callInfo)
mock.lockCreateTimelineItem.Unlock()
if mock.CreateTimelineItemFunc == nil {
var (
timelineItemOut nakama.TimelineItem
errOut error
)
return timelineItemOut, errOut
}
return mock.CreateTimelineItemFunc(ctx, content, spoilerOf, nsfw, media)
}
// CreateTimelineItemCalls gets all the calls that were made to CreateTimelineItem.
// Check the length with:
//
// len(mockedService.CreateTimelineItemCalls())
func (mock *ServiceMock) CreateTimelineItemCalls() []struct {
Ctx context.Context
Content string
SpoilerOf *string
Nsfw bool
Media []io.ReadSeeker
} {
var calls []struct {
Ctx context.Context
Content string
SpoilerOf *string
Nsfw bool
Media []io.ReadSeeker
}
mock.lockCreateTimelineItem.RLock()
calls = mock.calls.CreateTimelineItem
mock.lockCreateTimelineItem.RUnlock()
return calls
}
// DeleteComment calls DeleteCommentFunc.
func (mock *ServiceMock) DeleteComment(ctx context.Context, commentID string) error {
callInfo := struct {
Ctx context.Context
CommentID string
}{
Ctx: ctx,
CommentID: commentID,
}
mock.lockDeleteComment.Lock()
mock.calls.DeleteComment = append(mock.calls.DeleteComment, callInfo)
mock.lockDeleteComment.Unlock()
if mock.DeleteCommentFunc == nil {
var (
errOut error
)
return errOut
}
return mock.DeleteCommentFunc(ctx, commentID)
}
// DeleteCommentCalls gets all the calls that were made to DeleteComment.
// Check the length with:
//
// len(mockedService.DeleteCommentCalls())
func (mock *ServiceMock) DeleteCommentCalls() []struct {
Ctx context.Context
CommentID string
} {
var calls []struct {
Ctx context.Context
CommentID string
}
mock.lockDeleteComment.RLock()
calls = mock.calls.DeleteComment
mock.lockDeleteComment.RUnlock()
return calls
}
// DeletePost calls DeletePostFunc.
func (mock *ServiceMock) DeletePost(ctx context.Context, postID string) error {
callInfo := struct {
Ctx context.Context
PostID string
}{
Ctx: ctx,
PostID: postID,
}
mock.lockDeletePost.Lock()
mock.calls.DeletePost = append(mock.calls.DeletePost, callInfo)
mock.lockDeletePost.Unlock()
if mock.DeletePostFunc == nil {
var (
errOut error
)
return errOut
}
return mock.DeletePostFunc(ctx, postID)
}
// DeletePostCalls gets all the calls that were made to DeletePost.
// Check the length with:
//
// len(mockedService.DeletePostCalls())
func (mock *ServiceMock) DeletePostCalls() []struct {
Ctx context.Context
PostID string
} {
var calls []struct {
Ctx context.Context
PostID string
}
mock.lockDeletePost.RLock()
calls = mock.calls.DeletePost
mock.lockDeletePost.RUnlock()
return calls
}
// DeleteTimelineItem calls DeleteTimelineItemFunc.