This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 228
/
zz_generated_router_mock.go
1511 lines (1412 loc) · 46.3 KB
/
zz_generated_router_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 fakes
import (
context "context"
sync "sync"
v1a "github.com/rancher/rio/pkg/apis/rio.cattle.io/v1"
v1 "github.com/rancher/rio/pkg/generated/controllers/rio.cattle.io/v1"
generic "github.com/rancher/wrangler/pkg/generic"
v1b "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
var (
lockRouterControllerMockAddGenericHandler sync.RWMutex
lockRouterControllerMockAddGenericRemoveHandler sync.RWMutex
lockRouterControllerMockCache sync.RWMutex
lockRouterControllerMockCreate sync.RWMutex
lockRouterControllerMockDelete sync.RWMutex
lockRouterControllerMockEnqueue sync.RWMutex
lockRouterControllerMockGet sync.RWMutex
lockRouterControllerMockGroupVersionKind sync.RWMutex
lockRouterControllerMockInformer sync.RWMutex
lockRouterControllerMockList sync.RWMutex
lockRouterControllerMockOnChange sync.RWMutex
lockRouterControllerMockOnRemove sync.RWMutex
lockRouterControllerMockPatch sync.RWMutex
lockRouterControllerMockUpdate sync.RWMutex
lockRouterControllerMockUpdateStatus sync.RWMutex
lockRouterControllerMockUpdater sync.RWMutex
lockRouterControllerMockWatch sync.RWMutex
)
// Ensure, that RouterControllerMock does implement RouterController.
// If this is not the case, regenerate this file with moq.
var _ v1.RouterController = &RouterControllerMock{}
// RouterControllerMock is a mock implementation of RouterController.
//
// func TestSomethingThatUsesRouterController(t *testing.T) {
//
// // make and configure a mocked RouterController
// mockedRouterController := &RouterControllerMock{
// AddGenericHandlerFunc: func(ctx context.Context, name string, handler generic.Handler) {
// panic("mock out the AddGenericHandler method")
// },
// AddGenericRemoveHandlerFunc: func(ctx context.Context, name string, handler generic.Handler) {
// panic("mock out the AddGenericRemoveHandler method")
// },
// CacheFunc: func() v1.RouterCache {
// panic("mock out the Cache method")
// },
// CreateFunc: func(in1 *v1a.Router) (*v1a.Router, error) {
// panic("mock out the Create method")
// },
// DeleteFunc: func(namespace string, name string, options *v1b.DeleteOptions) error {
// panic("mock out the Delete method")
// },
// EnqueueFunc: func(namespace string, name string) {
// panic("mock out the Enqueue method")
// },
// GetFunc: func(namespace string, name string, options v1b.GetOptions) (*v1a.Router, error) {
// panic("mock out the Get method")
// },
// GroupVersionKindFunc: func() schema.GroupVersionKind {
// panic("mock out the GroupVersionKind method")
// },
// InformerFunc: func() cache.SharedIndexInformer {
// panic("mock out the Informer method")
// },
// ListFunc: func(namespace string, opts v1b.ListOptions) (*v1a.RouterList, error) {
// panic("mock out the List method")
// },
// OnChangeFunc: func(ctx context.Context, name string, sync v1.RouterHandler) {
// panic("mock out the OnChange method")
// },
// OnRemoveFunc: func(ctx context.Context, name string, sync v1.RouterHandler) {
// panic("mock out the OnRemove method")
// },
// PatchFunc: func(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Router, error) {
// panic("mock out the Patch method")
// },
// UpdateFunc: func(in1 *v1a.Router) (*v1a.Router, error) {
// panic("mock out the Update method")
// },
// UpdateStatusFunc: func(in1 *v1a.Router) (*v1a.Router, error) {
// panic("mock out the UpdateStatus method")
// },
// UpdaterFunc: func() generic.Updater {
// panic("mock out the Updater method")
// },
// WatchFunc: func(namespace string, opts v1b.ListOptions) (watch.Interface, error) {
// panic("mock out the Watch method")
// },
// }
//
// // use mockedRouterController in code that requires RouterController
// // and then make assertions.
//
// }
type RouterControllerMock struct {
// AddGenericHandlerFunc mocks the AddGenericHandler method.
AddGenericHandlerFunc func(ctx context.Context, name string, handler generic.Handler)
// AddGenericRemoveHandlerFunc mocks the AddGenericRemoveHandler method.
AddGenericRemoveHandlerFunc func(ctx context.Context, name string, handler generic.Handler)
// CacheFunc mocks the Cache method.
CacheFunc func() v1.RouterCache
// CreateFunc mocks the Create method.
CreateFunc func(in1 *v1a.Router) (*v1a.Router, error)
// DeleteFunc mocks the Delete method.
DeleteFunc func(namespace string, name string, options *v1b.DeleteOptions) error
// EnqueueFunc mocks the Enqueue method.
EnqueueFunc func(namespace string, name string)
// GetFunc mocks the Get method.
GetFunc func(namespace string, name string, options v1b.GetOptions) (*v1a.Router, error)
// GroupVersionKindFunc mocks the GroupVersionKind method.
GroupVersionKindFunc func() schema.GroupVersionKind
// InformerFunc mocks the Informer method.
InformerFunc func() cache.SharedIndexInformer
// ListFunc mocks the List method.
ListFunc func(namespace string, opts v1b.ListOptions) (*v1a.RouterList, error)
// OnChangeFunc mocks the OnChange method.
OnChangeFunc func(ctx context.Context, name string, sync v1.RouterHandler)
// OnRemoveFunc mocks the OnRemove method.
OnRemoveFunc func(ctx context.Context, name string, sync v1.RouterHandler)
// PatchFunc mocks the Patch method.
PatchFunc func(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Router, error)
// UpdateFunc mocks the Update method.
UpdateFunc func(in1 *v1a.Router) (*v1a.Router, error)
// UpdateStatusFunc mocks the UpdateStatus method.
UpdateStatusFunc func(in1 *v1a.Router) (*v1a.Router, error)
// UpdaterFunc mocks the Updater method.
UpdaterFunc func() generic.Updater
// WatchFunc mocks the Watch method.
WatchFunc func(namespace string, opts v1b.ListOptions) (watch.Interface, error)
// calls tracks calls to the methods.
calls struct {
// AddGenericHandler holds details about calls to the AddGenericHandler method.
AddGenericHandler []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Name is the name argument value.
Name string
// Handler is the handler argument value.
Handler generic.Handler
}
// AddGenericRemoveHandler holds details about calls to the AddGenericRemoveHandler method.
AddGenericRemoveHandler []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Name is the name argument value.
Name string
// Handler is the handler argument value.
Handler generic.Handler
}
// Cache holds details about calls to the Cache method.
Cache []struct {
}
// Create holds details about calls to the Create method.
Create []struct {
// In1 is the in1 argument value.
In1 *v1a.Router
}
// Delete holds details about calls to the Delete method.
Delete []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
// Options is the options argument value.
Options *v1b.DeleteOptions
}
// Enqueue holds details about calls to the Enqueue method.
Enqueue []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
}
// Get holds details about calls to the Get method.
Get []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
// Options is the options argument value.
Options v1b.GetOptions
}
// GroupVersionKind holds details about calls to the GroupVersionKind method.
GroupVersionKind []struct {
}
// Informer holds details about calls to the Informer method.
Informer []struct {
}
// List holds details about calls to the List method.
List []struct {
// Namespace is the namespace argument value.
Namespace string
// Opts is the opts argument value.
Opts v1b.ListOptions
}
// OnChange holds details about calls to the OnChange method.
OnChange []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Name is the name argument value.
Name string
// Sync is the sync argument value.
Sync v1.RouterHandler
}
// OnRemove holds details about calls to the OnRemove method.
OnRemove []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Name is the name argument value.
Name string
// Sync is the sync argument value.
Sync v1.RouterHandler
}
// Patch holds details about calls to the Patch method.
Patch []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
// Pt is the pt argument value.
Pt types.PatchType
// Data is the data argument value.
Data []byte
// Subresources is the subresources argument value.
Subresources []string
}
// Update holds details about calls to the Update method.
Update []struct {
// In1 is the in1 argument value.
In1 *v1a.Router
}
// UpdateStatus holds details about calls to the UpdateStatus method.
UpdateStatus []struct {
// In1 is the in1 argument value.
In1 *v1a.Router
}
// Updater holds details about calls to the Updater method.
Updater []struct {
}
// Watch holds details about calls to the Watch method.
Watch []struct {
// Namespace is the namespace argument value.
Namespace string
// Opts is the opts argument value.
Opts v1b.ListOptions
}
}
}
// AddGenericHandler calls AddGenericHandlerFunc.
func (mock *RouterControllerMock) AddGenericHandler(ctx context.Context, name string, handler generic.Handler) {
if mock.AddGenericHandlerFunc == nil {
panic("RouterControllerMock.AddGenericHandlerFunc: method is nil but RouterController.AddGenericHandler was just called")
}
callInfo := struct {
Ctx context.Context
Name string
Handler generic.Handler
}{
Ctx: ctx,
Name: name,
Handler: handler,
}
lockRouterControllerMockAddGenericHandler.Lock()
mock.calls.AddGenericHandler = append(mock.calls.AddGenericHandler, callInfo)
lockRouterControllerMockAddGenericHandler.Unlock()
mock.AddGenericHandlerFunc(ctx, name, handler)
}
// AddGenericHandlerCalls gets all the calls that were made to AddGenericHandler.
// Check the length with:
// len(mockedRouterController.AddGenericHandlerCalls())
func (mock *RouterControllerMock) AddGenericHandlerCalls() []struct {
Ctx context.Context
Name string
Handler generic.Handler
} {
var calls []struct {
Ctx context.Context
Name string
Handler generic.Handler
}
lockRouterControllerMockAddGenericHandler.RLock()
calls = mock.calls.AddGenericHandler
lockRouterControllerMockAddGenericHandler.RUnlock()
return calls
}
// AddGenericRemoveHandler calls AddGenericRemoveHandlerFunc.
func (mock *RouterControllerMock) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler) {
if mock.AddGenericRemoveHandlerFunc == nil {
panic("RouterControllerMock.AddGenericRemoveHandlerFunc: method is nil but RouterController.AddGenericRemoveHandler was just called")
}
callInfo := struct {
Ctx context.Context
Name string
Handler generic.Handler
}{
Ctx: ctx,
Name: name,
Handler: handler,
}
lockRouterControllerMockAddGenericRemoveHandler.Lock()
mock.calls.AddGenericRemoveHandler = append(mock.calls.AddGenericRemoveHandler, callInfo)
lockRouterControllerMockAddGenericRemoveHandler.Unlock()
mock.AddGenericRemoveHandlerFunc(ctx, name, handler)
}
// AddGenericRemoveHandlerCalls gets all the calls that were made to AddGenericRemoveHandler.
// Check the length with:
// len(mockedRouterController.AddGenericRemoveHandlerCalls())
func (mock *RouterControllerMock) AddGenericRemoveHandlerCalls() []struct {
Ctx context.Context
Name string
Handler generic.Handler
} {
var calls []struct {
Ctx context.Context
Name string
Handler generic.Handler
}
lockRouterControllerMockAddGenericRemoveHandler.RLock()
calls = mock.calls.AddGenericRemoveHandler
lockRouterControllerMockAddGenericRemoveHandler.RUnlock()
return calls
}
// Cache calls CacheFunc.
func (mock *RouterControllerMock) Cache() v1.RouterCache {
if mock.CacheFunc == nil {
panic("RouterControllerMock.CacheFunc: method is nil but RouterController.Cache was just called")
}
callInfo := struct {
}{}
lockRouterControllerMockCache.Lock()
mock.calls.Cache = append(mock.calls.Cache, callInfo)
lockRouterControllerMockCache.Unlock()
return mock.CacheFunc()
}
// CacheCalls gets all the calls that were made to Cache.
// Check the length with:
// len(mockedRouterController.CacheCalls())
func (mock *RouterControllerMock) CacheCalls() []struct {
} {
var calls []struct {
}
lockRouterControllerMockCache.RLock()
calls = mock.calls.Cache
lockRouterControllerMockCache.RUnlock()
return calls
}
// Create calls CreateFunc.
func (mock *RouterControllerMock) Create(in1 *v1a.Router) (*v1a.Router, error) {
if mock.CreateFunc == nil {
panic("RouterControllerMock.CreateFunc: method is nil but RouterController.Create was just called")
}
callInfo := struct {
In1 *v1a.Router
}{
In1: in1,
}
lockRouterControllerMockCreate.Lock()
mock.calls.Create = append(mock.calls.Create, callInfo)
lockRouterControllerMockCreate.Unlock()
return mock.CreateFunc(in1)
}
// CreateCalls gets all the calls that were made to Create.
// Check the length with:
// len(mockedRouterController.CreateCalls())
func (mock *RouterControllerMock) CreateCalls() []struct {
In1 *v1a.Router
} {
var calls []struct {
In1 *v1a.Router
}
lockRouterControllerMockCreate.RLock()
calls = mock.calls.Create
lockRouterControllerMockCreate.RUnlock()
return calls
}
// Delete calls DeleteFunc.
func (mock *RouterControllerMock) Delete(namespace string, name string, options *v1b.DeleteOptions) error {
if mock.DeleteFunc == nil {
panic("RouterControllerMock.DeleteFunc: method is nil but RouterController.Delete was just called")
}
callInfo := struct {
Namespace string
Name string
Options *v1b.DeleteOptions
}{
Namespace: namespace,
Name: name,
Options: options,
}
lockRouterControllerMockDelete.Lock()
mock.calls.Delete = append(mock.calls.Delete, callInfo)
lockRouterControllerMockDelete.Unlock()
return mock.DeleteFunc(namespace, name, options)
}
// DeleteCalls gets all the calls that were made to Delete.
// Check the length with:
// len(mockedRouterController.DeleteCalls())
func (mock *RouterControllerMock) DeleteCalls() []struct {
Namespace string
Name string
Options *v1b.DeleteOptions
} {
var calls []struct {
Namespace string
Name string
Options *v1b.DeleteOptions
}
lockRouterControllerMockDelete.RLock()
calls = mock.calls.Delete
lockRouterControllerMockDelete.RUnlock()
return calls
}
// Enqueue calls EnqueueFunc.
func (mock *RouterControllerMock) Enqueue(namespace string, name string) {
if mock.EnqueueFunc == nil {
panic("RouterControllerMock.EnqueueFunc: method is nil but RouterController.Enqueue was just called")
}
callInfo := struct {
Namespace string
Name string
}{
Namespace: namespace,
Name: name,
}
lockRouterControllerMockEnqueue.Lock()
mock.calls.Enqueue = append(mock.calls.Enqueue, callInfo)
lockRouterControllerMockEnqueue.Unlock()
mock.EnqueueFunc(namespace, name)
}
// EnqueueCalls gets all the calls that were made to Enqueue.
// Check the length with:
// len(mockedRouterController.EnqueueCalls())
func (mock *RouterControllerMock) EnqueueCalls() []struct {
Namespace string
Name string
} {
var calls []struct {
Namespace string
Name string
}
lockRouterControllerMockEnqueue.RLock()
calls = mock.calls.Enqueue
lockRouterControllerMockEnqueue.RUnlock()
return calls
}
// Get calls GetFunc.
func (mock *RouterControllerMock) Get(namespace string, name string, options v1b.GetOptions) (*v1a.Router, error) {
if mock.GetFunc == nil {
panic("RouterControllerMock.GetFunc: method is nil but RouterController.Get was just called")
}
callInfo := struct {
Namespace string
Name string
Options v1b.GetOptions
}{
Namespace: namespace,
Name: name,
Options: options,
}
lockRouterControllerMockGet.Lock()
mock.calls.Get = append(mock.calls.Get, callInfo)
lockRouterControllerMockGet.Unlock()
return mock.GetFunc(namespace, name, options)
}
// GetCalls gets all the calls that were made to Get.
// Check the length with:
// len(mockedRouterController.GetCalls())
func (mock *RouterControllerMock) GetCalls() []struct {
Namespace string
Name string
Options v1b.GetOptions
} {
var calls []struct {
Namespace string
Name string
Options v1b.GetOptions
}
lockRouterControllerMockGet.RLock()
calls = mock.calls.Get
lockRouterControllerMockGet.RUnlock()
return calls
}
// GroupVersionKind calls GroupVersionKindFunc.
func (mock *RouterControllerMock) GroupVersionKind() schema.GroupVersionKind {
if mock.GroupVersionKindFunc == nil {
panic("RouterControllerMock.GroupVersionKindFunc: method is nil but RouterController.GroupVersionKind was just called")
}
callInfo := struct {
}{}
lockRouterControllerMockGroupVersionKind.Lock()
mock.calls.GroupVersionKind = append(mock.calls.GroupVersionKind, callInfo)
lockRouterControllerMockGroupVersionKind.Unlock()
return mock.GroupVersionKindFunc()
}
// GroupVersionKindCalls gets all the calls that were made to GroupVersionKind.
// Check the length with:
// len(mockedRouterController.GroupVersionKindCalls())
func (mock *RouterControllerMock) GroupVersionKindCalls() []struct {
} {
var calls []struct {
}
lockRouterControllerMockGroupVersionKind.RLock()
calls = mock.calls.GroupVersionKind
lockRouterControllerMockGroupVersionKind.RUnlock()
return calls
}
// Informer calls InformerFunc.
func (mock *RouterControllerMock) Informer() cache.SharedIndexInformer {
if mock.InformerFunc == nil {
panic("RouterControllerMock.InformerFunc: method is nil but RouterController.Informer was just called")
}
callInfo := struct {
}{}
lockRouterControllerMockInformer.Lock()
mock.calls.Informer = append(mock.calls.Informer, callInfo)
lockRouterControllerMockInformer.Unlock()
return mock.InformerFunc()
}
// InformerCalls gets all the calls that were made to Informer.
// Check the length with:
// len(mockedRouterController.InformerCalls())
func (mock *RouterControllerMock) InformerCalls() []struct {
} {
var calls []struct {
}
lockRouterControllerMockInformer.RLock()
calls = mock.calls.Informer
lockRouterControllerMockInformer.RUnlock()
return calls
}
// List calls ListFunc.
func (mock *RouterControllerMock) List(namespace string, opts v1b.ListOptions) (*v1a.RouterList, error) {
if mock.ListFunc == nil {
panic("RouterControllerMock.ListFunc: method is nil but RouterController.List was just called")
}
callInfo := struct {
Namespace string
Opts v1b.ListOptions
}{
Namespace: namespace,
Opts: opts,
}
lockRouterControllerMockList.Lock()
mock.calls.List = append(mock.calls.List, callInfo)
lockRouterControllerMockList.Unlock()
return mock.ListFunc(namespace, opts)
}
// ListCalls gets all the calls that were made to List.
// Check the length with:
// len(mockedRouterController.ListCalls())
func (mock *RouterControllerMock) ListCalls() []struct {
Namespace string
Opts v1b.ListOptions
} {
var calls []struct {
Namespace string
Opts v1b.ListOptions
}
lockRouterControllerMockList.RLock()
calls = mock.calls.List
lockRouterControllerMockList.RUnlock()
return calls
}
// OnChange calls OnChangeFunc.
func (mock *RouterControllerMock) OnChange(ctx context.Context, name string, sync v1.RouterHandler) {
if mock.OnChangeFunc == nil {
panic("RouterControllerMock.OnChangeFunc: method is nil but RouterController.OnChange was just called")
}
callInfo := struct {
Ctx context.Context
Name string
Sync v1.RouterHandler
}{
Ctx: ctx,
Name: name,
Sync: sync,
}
lockRouterControllerMockOnChange.Lock()
mock.calls.OnChange = append(mock.calls.OnChange, callInfo)
lockRouterControllerMockOnChange.Unlock()
mock.OnChangeFunc(ctx, name, sync)
}
// OnChangeCalls gets all the calls that were made to OnChange.
// Check the length with:
// len(mockedRouterController.OnChangeCalls())
func (mock *RouterControllerMock) OnChangeCalls() []struct {
Ctx context.Context
Name string
Sync v1.RouterHandler
} {
var calls []struct {
Ctx context.Context
Name string
Sync v1.RouterHandler
}
lockRouterControllerMockOnChange.RLock()
calls = mock.calls.OnChange
lockRouterControllerMockOnChange.RUnlock()
return calls
}
// OnRemove calls OnRemoveFunc.
func (mock *RouterControllerMock) OnRemove(ctx context.Context, name string, sync v1.RouterHandler) {
if mock.OnRemoveFunc == nil {
panic("RouterControllerMock.OnRemoveFunc: method is nil but RouterController.OnRemove was just called")
}
callInfo := struct {
Ctx context.Context
Name string
Sync v1.RouterHandler
}{
Ctx: ctx,
Name: name,
Sync: sync,
}
lockRouterControllerMockOnRemove.Lock()
mock.calls.OnRemove = append(mock.calls.OnRemove, callInfo)
lockRouterControllerMockOnRemove.Unlock()
mock.OnRemoveFunc(ctx, name, sync)
}
// OnRemoveCalls gets all the calls that were made to OnRemove.
// Check the length with:
// len(mockedRouterController.OnRemoveCalls())
func (mock *RouterControllerMock) OnRemoveCalls() []struct {
Ctx context.Context
Name string
Sync v1.RouterHandler
} {
var calls []struct {
Ctx context.Context
Name string
Sync v1.RouterHandler
}
lockRouterControllerMockOnRemove.RLock()
calls = mock.calls.OnRemove
lockRouterControllerMockOnRemove.RUnlock()
return calls
}
// Patch calls PatchFunc.
func (mock *RouterControllerMock) Patch(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Router, error) {
if mock.PatchFunc == nil {
panic("RouterControllerMock.PatchFunc: method is nil but RouterController.Patch was just called")
}
callInfo := struct {
Namespace string
Name string
Pt types.PatchType
Data []byte
Subresources []string
}{
Namespace: namespace,
Name: name,
Pt: pt,
Data: data,
Subresources: subresources,
}
lockRouterControllerMockPatch.Lock()
mock.calls.Patch = append(mock.calls.Patch, callInfo)
lockRouterControllerMockPatch.Unlock()
return mock.PatchFunc(namespace, name, pt, data, subresources...)
}
// PatchCalls gets all the calls that were made to Patch.
// Check the length with:
// len(mockedRouterController.PatchCalls())
func (mock *RouterControllerMock) PatchCalls() []struct {
Namespace string
Name string
Pt types.PatchType
Data []byte
Subresources []string
} {
var calls []struct {
Namespace string
Name string
Pt types.PatchType
Data []byte
Subresources []string
}
lockRouterControllerMockPatch.RLock()
calls = mock.calls.Patch
lockRouterControllerMockPatch.RUnlock()
return calls
}
// Update calls UpdateFunc.
func (mock *RouterControllerMock) Update(in1 *v1a.Router) (*v1a.Router, error) {
if mock.UpdateFunc == nil {
panic("RouterControllerMock.UpdateFunc: method is nil but RouterController.Update was just called")
}
callInfo := struct {
In1 *v1a.Router
}{
In1: in1,
}
lockRouterControllerMockUpdate.Lock()
mock.calls.Update = append(mock.calls.Update, callInfo)
lockRouterControllerMockUpdate.Unlock()
return mock.UpdateFunc(in1)
}
// UpdateCalls gets all the calls that were made to Update.
// Check the length with:
// len(mockedRouterController.UpdateCalls())
func (mock *RouterControllerMock) UpdateCalls() []struct {
In1 *v1a.Router
} {
var calls []struct {
In1 *v1a.Router
}
lockRouterControllerMockUpdate.RLock()
calls = mock.calls.Update
lockRouterControllerMockUpdate.RUnlock()
return calls
}
// UpdateStatus calls UpdateStatusFunc.
func (mock *RouterControllerMock) UpdateStatus(in1 *v1a.Router) (*v1a.Router, error) {
if mock.UpdateStatusFunc == nil {
panic("RouterControllerMock.UpdateStatusFunc: method is nil but RouterController.UpdateStatus was just called")
}
callInfo := struct {
In1 *v1a.Router
}{
In1: in1,
}
lockRouterControllerMockUpdateStatus.Lock()
mock.calls.UpdateStatus = append(mock.calls.UpdateStatus, callInfo)
lockRouterControllerMockUpdateStatus.Unlock()
return mock.UpdateStatusFunc(in1)
}
// UpdateStatusCalls gets all the calls that were made to UpdateStatus.
// Check the length with:
// len(mockedRouterController.UpdateStatusCalls())
func (mock *RouterControllerMock) UpdateStatusCalls() []struct {
In1 *v1a.Router
} {
var calls []struct {
In1 *v1a.Router
}
lockRouterControllerMockUpdateStatus.RLock()
calls = mock.calls.UpdateStatus
lockRouterControllerMockUpdateStatus.RUnlock()
return calls
}
// Updater calls UpdaterFunc.
func (mock *RouterControllerMock) Updater() generic.Updater {
if mock.UpdaterFunc == nil {
panic("RouterControllerMock.UpdaterFunc: method is nil but RouterController.Updater was just called")
}
callInfo := struct {
}{}
lockRouterControllerMockUpdater.Lock()
mock.calls.Updater = append(mock.calls.Updater, callInfo)
lockRouterControllerMockUpdater.Unlock()
return mock.UpdaterFunc()
}
// UpdaterCalls gets all the calls that were made to Updater.
// Check the length with:
// len(mockedRouterController.UpdaterCalls())
func (mock *RouterControllerMock) UpdaterCalls() []struct {
} {
var calls []struct {
}
lockRouterControllerMockUpdater.RLock()
calls = mock.calls.Updater
lockRouterControllerMockUpdater.RUnlock()
return calls
}
// Watch calls WatchFunc.
func (mock *RouterControllerMock) Watch(namespace string, opts v1b.ListOptions) (watch.Interface, error) {
if mock.WatchFunc == nil {
panic("RouterControllerMock.WatchFunc: method is nil but RouterController.Watch was just called")
}
callInfo := struct {
Namespace string
Opts v1b.ListOptions
}{
Namespace: namespace,
Opts: opts,
}
lockRouterControllerMockWatch.Lock()
mock.calls.Watch = append(mock.calls.Watch, callInfo)
lockRouterControllerMockWatch.Unlock()
return mock.WatchFunc(namespace, opts)
}
// WatchCalls gets all the calls that were made to Watch.
// Check the length with:
// len(mockedRouterController.WatchCalls())
func (mock *RouterControllerMock) WatchCalls() []struct {
Namespace string
Opts v1b.ListOptions
} {
var calls []struct {
Namespace string
Opts v1b.ListOptions
}
lockRouterControllerMockWatch.RLock()
calls = mock.calls.Watch
lockRouterControllerMockWatch.RUnlock()
return calls
}
var (
lockRouterClientMockCreate sync.RWMutex
lockRouterClientMockDelete sync.RWMutex
lockRouterClientMockGet sync.RWMutex
lockRouterClientMockList sync.RWMutex
lockRouterClientMockPatch sync.RWMutex
lockRouterClientMockUpdate sync.RWMutex
lockRouterClientMockUpdateStatus sync.RWMutex
lockRouterClientMockWatch sync.RWMutex
)
// Ensure, that RouterClientMock does implement RouterClient.
// If this is not the case, regenerate this file with moq.
var _ v1.RouterClient = &RouterClientMock{}
// RouterClientMock is a mock implementation of RouterClient.
//
// func TestSomethingThatUsesRouterClient(t *testing.T) {
//
// // make and configure a mocked RouterClient
// mockedRouterClient := &RouterClientMock{
// CreateFunc: func(in1 *v1a.Router) (*v1a.Router, error) {
// panic("mock out the Create method")
// },
// DeleteFunc: func(namespace string, name string, options *v1b.DeleteOptions) error {
// panic("mock out the Delete method")
// },
// GetFunc: func(namespace string, name string, options v1b.GetOptions) (*v1a.Router, error) {
// panic("mock out the Get method")
// },
// ListFunc: func(namespace string, opts v1b.ListOptions) (*v1a.RouterList, error) {
// panic("mock out the List method")
// },
// PatchFunc: func(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Router, error) {
// panic("mock out the Patch method")
// },
// UpdateFunc: func(in1 *v1a.Router) (*v1a.Router, error) {
// panic("mock out the Update method")
// },
// UpdateStatusFunc: func(in1 *v1a.Router) (*v1a.Router, error) {
// panic("mock out the UpdateStatus method")
// },
// WatchFunc: func(namespace string, opts v1b.ListOptions) (watch.Interface, error) {
// panic("mock out the Watch method")
// },
// }
//
// // use mockedRouterClient in code that requires RouterClient
// // and then make assertions.
//
// }
type RouterClientMock struct {
// CreateFunc mocks the Create method.
CreateFunc func(in1 *v1a.Router) (*v1a.Router, error)
// DeleteFunc mocks the Delete method.
DeleteFunc func(namespace string, name string, options *v1b.DeleteOptions) error
// GetFunc mocks the Get method.
GetFunc func(namespace string, name string, options v1b.GetOptions) (*v1a.Router, error)
// ListFunc mocks the List method.
ListFunc func(namespace string, opts v1b.ListOptions) (*v1a.RouterList, error)
// PatchFunc mocks the Patch method.
PatchFunc func(namespace string, name string, pt types.PatchType, data []byte, subresources ...string) (*v1a.Router, error)
// UpdateFunc mocks the Update method.
UpdateFunc func(in1 *v1a.Router) (*v1a.Router, error)
// UpdateStatusFunc mocks the UpdateStatus method.
UpdateStatusFunc func(in1 *v1a.Router) (*v1a.Router, error)
// WatchFunc mocks the Watch method.
WatchFunc func(namespace string, opts v1b.ListOptions) (watch.Interface, error)
// calls tracks calls to the methods.
calls struct {
// Create holds details about calls to the Create method.
Create []struct {
// In1 is the in1 argument value.
In1 *v1a.Router
}
// Delete holds details about calls to the Delete method.
Delete []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
// Options is the options argument value.
Options *v1b.DeleteOptions
}
// Get holds details about calls to the Get method.
Get []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
// Options is the options argument value.
Options v1b.GetOptions
}
// List holds details about calls to the List method.
List []struct {
// Namespace is the namespace argument value.
Namespace string
// Opts is the opts argument value.
Opts v1b.ListOptions
}
// Patch holds details about calls to the Patch method.
Patch []struct {
// Namespace is the namespace argument value.
Namespace string
// Name is the name argument value.
Name string
// Pt is the pt argument value.
Pt types.PatchType
// Data is the data argument value.
Data []byte
// Subresources is the subresources argument value.
Subresources []string
}
// Update holds details about calls to the Update method.
Update []struct {
// In1 is the in1 argument value.
In1 *v1a.Router
}
// UpdateStatus holds details about calls to the UpdateStatus method.
UpdateStatus []struct {
// In1 is the in1 argument value.
In1 *v1a.Router
}
// Watch holds details about calls to the Watch method.
Watch []struct {
// Namespace is the namespace argument value.
Namespace string
// Opts is the opts argument value.
Opts v1b.ListOptions
}