forked from cloudfoundry-attic/garden-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_connection.go
881 lines (794 loc) · 25 KB
/
fake_connection.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
// This file was generated by counterfeiter
package fakes
import (
. "github.com/cloudfoundry-incubator/garden/client/connection"
"github.com/cloudfoundry-incubator/garden/api"
"io"
"sync"
)
type FakeConnection struct {
PingStub func() error
pingMutex sync.RWMutex
pingArgsForCall []struct{}
pingReturns struct {
result1 error
}
CapacityStub func() (api.Capacity, error)
capacityMutex sync.RWMutex
capacityArgsForCall []struct{}
capacityReturns struct {
result1 api.Capacity
result2 error
}
CreateStub func(spec api.ContainerSpec) (string, error)
createMutex sync.RWMutex
createArgsForCall []struct {
spec api.ContainerSpec
}
createReturns struct {
result1 string
result2 error
}
ListStub func(properties api.Properties) ([]string, error)
listMutex sync.RWMutex
listArgsForCall []struct {
properties api.Properties
}
listReturns struct {
result1 []string
result2 error
}
DestroyStub func(handle string) error
destroyMutex sync.RWMutex
destroyArgsForCall []struct {
handle string
}
destroyReturns struct {
result1 error
}
StopStub func(handle string, kill bool) error
stopMutex sync.RWMutex
stopArgsForCall []struct {
handle string
kill bool
}
stopReturns struct {
result1 error
}
InfoStub func(handle string) (api.ContainerInfo, error)
infoMutex sync.RWMutex
infoArgsForCall []struct {
handle string
}
infoReturns struct {
result1 api.ContainerInfo
result2 error
}
StreamInStub func(handle string, dstPath string, reader io.Reader) error
streamInMutex sync.RWMutex
streamInArgsForCall []struct {
handle string
dstPath string
reader io.Reader
}
streamInReturns struct {
result1 error
}
StreamOutStub func(handle string, srcPath string) (io.ReadCloser, error)
streamOutMutex sync.RWMutex
streamOutArgsForCall []struct {
handle string
srcPath string
}
streamOutReturns struct {
result1 io.ReadCloser
result2 error
}
LimitBandwidthStub func(handle string, limits api.BandwidthLimits) (api.BandwidthLimits, error)
limitBandwidthMutex sync.RWMutex
limitBandwidthArgsForCall []struct {
handle string
limits api.BandwidthLimits
}
limitBandwidthReturns struct {
result1 api.BandwidthLimits
result2 error
}
LimitCPUStub func(handle string, limits api.CPULimits) (api.CPULimits, error)
limitCPUMutex sync.RWMutex
limitCPUArgsForCall []struct {
handle string
limits api.CPULimits
}
limitCPUReturns struct {
result1 api.CPULimits
result2 error
}
LimitDiskStub func(handle string, limits api.DiskLimits) (api.DiskLimits, error)
limitDiskMutex sync.RWMutex
limitDiskArgsForCall []struct {
handle string
limits api.DiskLimits
}
limitDiskReturns struct {
result1 api.DiskLimits
result2 error
}
LimitMemoryStub func(handle string, limit api.MemoryLimits) (api.MemoryLimits, error)
limitMemoryMutex sync.RWMutex
limitMemoryArgsForCall []struct {
handle string
limit api.MemoryLimits
}
limitMemoryReturns struct {
result1 api.MemoryLimits
result2 error
}
CurrentBandwidthLimitsStub func(handle string) (api.BandwidthLimits, error)
currentBandwidthLimitsMutex sync.RWMutex
currentBandwidthLimitsArgsForCall []struct {
handle string
}
currentBandwidthLimitsReturns struct {
result1 api.BandwidthLimits
result2 error
}
CurrentCPULimitsStub func(handle string) (api.CPULimits, error)
currentCPULimitsMutex sync.RWMutex
currentCPULimitsArgsForCall []struct {
handle string
}
currentCPULimitsReturns struct {
result1 api.CPULimits
result2 error
}
CurrentDiskLimitsStub func(handle string) (api.DiskLimits, error)
currentDiskLimitsMutex sync.RWMutex
currentDiskLimitsArgsForCall []struct {
handle string
}
currentDiskLimitsReturns struct {
result1 api.DiskLimits
result2 error
}
CurrentMemoryLimitsStub func(handle string) (api.MemoryLimits, error)
currentMemoryLimitsMutex sync.RWMutex
currentMemoryLimitsArgsForCall []struct {
handle string
}
currentMemoryLimitsReturns struct {
result1 api.MemoryLimits
result2 error
}
RunStub func(handle string, spec api.ProcessSpec, io api.ProcessIO) (api.Process, error)
runMutex sync.RWMutex
runArgsForCall []struct {
handle string
spec api.ProcessSpec
io api.ProcessIO
}
runReturns struct {
result1 api.Process
result2 error
}
AttachStub func(handle string, processID uint32, io api.ProcessIO) (api.Process, error)
attachMutex sync.RWMutex
attachArgsForCall []struct {
handle string
processID uint32
io api.ProcessIO
}
attachReturns struct {
result1 api.Process
result2 error
}
NetInStub func(handle string, hostPort, containerPort uint32) (uint32, uint32, error)
netInMutex sync.RWMutex
netInArgsForCall []struct {
handle string
hostPort uint32
containerPort uint32
}
netInReturns struct {
result1 uint32
result2 uint32
result3 error
}
NetOutStub func(handle string, network string, port uint32) error
netOutMutex sync.RWMutex
netOutArgsForCall []struct {
handle string
network string
port uint32
}
netOutReturns struct {
result1 error
}
}
func (fake *FakeConnection) Ping() error {
fake.pingMutex.Lock()
defer fake.pingMutex.Unlock()
fake.pingArgsForCall = append(fake.pingArgsForCall, struct{}{})
if fake.PingStub != nil {
return fake.PingStub()
} else {
return fake.pingReturns.result1
}
}
func (fake *FakeConnection) PingCallCount() int {
fake.pingMutex.RLock()
defer fake.pingMutex.RUnlock()
return len(fake.pingArgsForCall)
}
func (fake *FakeConnection) PingReturns(result1 error) {
fake.pingReturns = struct {
result1 error
}{result1}
}
func (fake *FakeConnection) Capacity() (api.Capacity, error) {
fake.capacityMutex.Lock()
defer fake.capacityMutex.Unlock()
fake.capacityArgsForCall = append(fake.capacityArgsForCall, struct{}{})
if fake.CapacityStub != nil {
return fake.CapacityStub()
} else {
return fake.capacityReturns.result1, fake.capacityReturns.result2
}
}
func (fake *FakeConnection) CapacityCallCount() int {
fake.capacityMutex.RLock()
defer fake.capacityMutex.RUnlock()
return len(fake.capacityArgsForCall)
}
func (fake *FakeConnection) CapacityReturns(result1 api.Capacity, result2 error) {
fake.capacityReturns = struct {
result1 api.Capacity
result2 error
}{result1, result2}
}
func (fake *FakeConnection) Create(spec api.ContainerSpec) (string, error) {
fake.createMutex.Lock()
defer fake.createMutex.Unlock()
fake.createArgsForCall = append(fake.createArgsForCall, struct {
spec api.ContainerSpec
}{spec})
if fake.CreateStub != nil {
return fake.CreateStub(spec)
} else {
return fake.createReturns.result1, fake.createReturns.result2
}
}
func (fake *FakeConnection) CreateCallCount() int {
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
return len(fake.createArgsForCall)
}
func (fake *FakeConnection) CreateArgsForCall(i int) api.ContainerSpec {
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
return fake.createArgsForCall[i].spec
}
func (fake *FakeConnection) CreateReturns(result1 string, result2 error) {
fake.createReturns = struct {
result1 string
result2 error
}{result1, result2}
}
func (fake *FakeConnection) List(properties api.Properties) ([]string, error) {
fake.listMutex.Lock()
defer fake.listMutex.Unlock()
fake.listArgsForCall = append(fake.listArgsForCall, struct {
properties api.Properties
}{properties})
if fake.ListStub != nil {
return fake.ListStub(properties)
} else {
return fake.listReturns.result1, fake.listReturns.result2
}
}
func (fake *FakeConnection) ListCallCount() int {
fake.listMutex.RLock()
defer fake.listMutex.RUnlock()
return len(fake.listArgsForCall)
}
func (fake *FakeConnection) ListArgsForCall(i int) api.Properties {
fake.listMutex.RLock()
defer fake.listMutex.RUnlock()
return fake.listArgsForCall[i].properties
}
func (fake *FakeConnection) ListReturns(result1 []string, result2 error) {
fake.listReturns = struct {
result1 []string
result2 error
}{result1, result2}
}
func (fake *FakeConnection) Destroy(handle string) error {
fake.destroyMutex.Lock()
defer fake.destroyMutex.Unlock()
fake.destroyArgsForCall = append(fake.destroyArgsForCall, struct {
handle string
}{handle})
if fake.DestroyStub != nil {
return fake.DestroyStub(handle)
} else {
return fake.destroyReturns.result1
}
}
func (fake *FakeConnection) DestroyCallCount() int {
fake.destroyMutex.RLock()
defer fake.destroyMutex.RUnlock()
return len(fake.destroyArgsForCall)
}
func (fake *FakeConnection) DestroyArgsForCall(i int) string {
fake.destroyMutex.RLock()
defer fake.destroyMutex.RUnlock()
return fake.destroyArgsForCall[i].handle
}
func (fake *FakeConnection) DestroyReturns(result1 error) {
fake.destroyReturns = struct {
result1 error
}{result1}
}
func (fake *FakeConnection) Stop(handle string, kill bool) error {
fake.stopMutex.Lock()
defer fake.stopMutex.Unlock()
fake.stopArgsForCall = append(fake.stopArgsForCall, struct {
handle string
kill bool
}{handle, kill})
if fake.StopStub != nil {
return fake.StopStub(handle, kill)
} else {
return fake.stopReturns.result1
}
}
func (fake *FakeConnection) StopCallCount() int {
fake.stopMutex.RLock()
defer fake.stopMutex.RUnlock()
return len(fake.stopArgsForCall)
}
func (fake *FakeConnection) StopArgsForCall(i int) (string, bool) {
fake.stopMutex.RLock()
defer fake.stopMutex.RUnlock()
return fake.stopArgsForCall[i].handle, fake.stopArgsForCall[i].kill
}
func (fake *FakeConnection) StopReturns(result1 error) {
fake.stopReturns = struct {
result1 error
}{result1}
}
func (fake *FakeConnection) Info(handle string) (api.ContainerInfo, error) {
fake.infoMutex.Lock()
defer fake.infoMutex.Unlock()
fake.infoArgsForCall = append(fake.infoArgsForCall, struct {
handle string
}{handle})
if fake.InfoStub != nil {
return fake.InfoStub(handle)
} else {
return fake.infoReturns.result1, fake.infoReturns.result2
}
}
func (fake *FakeConnection) InfoCallCount() int {
fake.infoMutex.RLock()
defer fake.infoMutex.RUnlock()
return len(fake.infoArgsForCall)
}
func (fake *FakeConnection) InfoArgsForCall(i int) string {
fake.infoMutex.RLock()
defer fake.infoMutex.RUnlock()
return fake.infoArgsForCall[i].handle
}
func (fake *FakeConnection) InfoReturns(result1 api.ContainerInfo, result2 error) {
fake.infoReturns = struct {
result1 api.ContainerInfo
result2 error
}{result1, result2}
}
func (fake *FakeConnection) StreamIn(handle string, dstPath string, reader io.Reader) error {
fake.streamInMutex.Lock()
defer fake.streamInMutex.Unlock()
fake.streamInArgsForCall = append(fake.streamInArgsForCall, struct {
handle string
dstPath string
reader io.Reader
}{handle, dstPath, reader})
if fake.StreamInStub != nil {
return fake.StreamInStub(handle, dstPath, reader)
} else {
return fake.streamInReturns.result1
}
}
func (fake *FakeConnection) StreamInCallCount() int {
fake.streamInMutex.RLock()
defer fake.streamInMutex.RUnlock()
return len(fake.streamInArgsForCall)
}
func (fake *FakeConnection) StreamInArgsForCall(i int) (string, string, io.Reader) {
fake.streamInMutex.RLock()
defer fake.streamInMutex.RUnlock()
return fake.streamInArgsForCall[i].handle, fake.streamInArgsForCall[i].dstPath, fake.streamInArgsForCall[i].reader
}
func (fake *FakeConnection) StreamInReturns(result1 error) {
fake.streamInReturns = struct {
result1 error
}{result1}
}
func (fake *FakeConnection) StreamOut(handle string, srcPath string) (io.ReadCloser, error) {
fake.streamOutMutex.Lock()
defer fake.streamOutMutex.Unlock()
fake.streamOutArgsForCall = append(fake.streamOutArgsForCall, struct {
handle string
srcPath string
}{handle, srcPath})
if fake.StreamOutStub != nil {
return fake.StreamOutStub(handle, srcPath)
} else {
return fake.streamOutReturns.result1, fake.streamOutReturns.result2
}
}
func (fake *FakeConnection) StreamOutCallCount() int {
fake.streamOutMutex.RLock()
defer fake.streamOutMutex.RUnlock()
return len(fake.streamOutArgsForCall)
}
func (fake *FakeConnection) StreamOutArgsForCall(i int) (string, string) {
fake.streamOutMutex.RLock()
defer fake.streamOutMutex.RUnlock()
return fake.streamOutArgsForCall[i].handle, fake.streamOutArgsForCall[i].srcPath
}
func (fake *FakeConnection) StreamOutReturns(result1 io.ReadCloser, result2 error) {
fake.streamOutReturns = struct {
result1 io.ReadCloser
result2 error
}{result1, result2}
}
func (fake *FakeConnection) LimitBandwidth(handle string, limits api.BandwidthLimits) (api.BandwidthLimits, error) {
fake.limitBandwidthMutex.Lock()
defer fake.limitBandwidthMutex.Unlock()
fake.limitBandwidthArgsForCall = append(fake.limitBandwidthArgsForCall, struct {
handle string
limits api.BandwidthLimits
}{handle, limits})
if fake.LimitBandwidthStub != nil {
return fake.LimitBandwidthStub(handle, limits)
} else {
return fake.limitBandwidthReturns.result1, fake.limitBandwidthReturns.result2
}
}
func (fake *FakeConnection) LimitBandwidthCallCount() int {
fake.limitBandwidthMutex.RLock()
defer fake.limitBandwidthMutex.RUnlock()
return len(fake.limitBandwidthArgsForCall)
}
func (fake *FakeConnection) LimitBandwidthArgsForCall(i int) (string, api.BandwidthLimits) {
fake.limitBandwidthMutex.RLock()
defer fake.limitBandwidthMutex.RUnlock()
return fake.limitBandwidthArgsForCall[i].handle, fake.limitBandwidthArgsForCall[i].limits
}
func (fake *FakeConnection) LimitBandwidthReturns(result1 api.BandwidthLimits, result2 error) {
fake.limitBandwidthReturns = struct {
result1 api.BandwidthLimits
result2 error
}{result1, result2}
}
func (fake *FakeConnection) LimitCPU(handle string, limits api.CPULimits) (api.CPULimits, error) {
fake.limitCPUMutex.Lock()
defer fake.limitCPUMutex.Unlock()
fake.limitCPUArgsForCall = append(fake.limitCPUArgsForCall, struct {
handle string
limits api.CPULimits
}{handle, limits})
if fake.LimitCPUStub != nil {
return fake.LimitCPUStub(handle, limits)
} else {
return fake.limitCPUReturns.result1, fake.limitCPUReturns.result2
}
}
func (fake *FakeConnection) LimitCPUCallCount() int {
fake.limitCPUMutex.RLock()
defer fake.limitCPUMutex.RUnlock()
return len(fake.limitCPUArgsForCall)
}
func (fake *FakeConnection) LimitCPUArgsForCall(i int) (string, api.CPULimits) {
fake.limitCPUMutex.RLock()
defer fake.limitCPUMutex.RUnlock()
return fake.limitCPUArgsForCall[i].handle, fake.limitCPUArgsForCall[i].limits
}
func (fake *FakeConnection) LimitCPUReturns(result1 api.CPULimits, result2 error) {
fake.limitCPUReturns = struct {
result1 api.CPULimits
result2 error
}{result1, result2}
}
func (fake *FakeConnection) LimitDisk(handle string, limits api.DiskLimits) (api.DiskLimits, error) {
fake.limitDiskMutex.Lock()
defer fake.limitDiskMutex.Unlock()
fake.limitDiskArgsForCall = append(fake.limitDiskArgsForCall, struct {
handle string
limits api.DiskLimits
}{handle, limits})
if fake.LimitDiskStub != nil {
return fake.LimitDiskStub(handle, limits)
} else {
return fake.limitDiskReturns.result1, fake.limitDiskReturns.result2
}
}
func (fake *FakeConnection) LimitDiskCallCount() int {
fake.limitDiskMutex.RLock()
defer fake.limitDiskMutex.RUnlock()
return len(fake.limitDiskArgsForCall)
}
func (fake *FakeConnection) LimitDiskArgsForCall(i int) (string, api.DiskLimits) {
fake.limitDiskMutex.RLock()
defer fake.limitDiskMutex.RUnlock()
return fake.limitDiskArgsForCall[i].handle, fake.limitDiskArgsForCall[i].limits
}
func (fake *FakeConnection) LimitDiskReturns(result1 api.DiskLimits, result2 error) {
fake.limitDiskReturns = struct {
result1 api.DiskLimits
result2 error
}{result1, result2}
}
func (fake *FakeConnection) LimitMemory(handle string, limit api.MemoryLimits) (api.MemoryLimits, error) {
fake.limitMemoryMutex.Lock()
defer fake.limitMemoryMutex.Unlock()
fake.limitMemoryArgsForCall = append(fake.limitMemoryArgsForCall, struct {
handle string
limit api.MemoryLimits
}{handle, limit})
if fake.LimitMemoryStub != nil {
return fake.LimitMemoryStub(handle, limit)
} else {
return fake.limitMemoryReturns.result1, fake.limitMemoryReturns.result2
}
}
func (fake *FakeConnection) LimitMemoryCallCount() int {
fake.limitMemoryMutex.RLock()
defer fake.limitMemoryMutex.RUnlock()
return len(fake.limitMemoryArgsForCall)
}
func (fake *FakeConnection) LimitMemoryArgsForCall(i int) (string, api.MemoryLimits) {
fake.limitMemoryMutex.RLock()
defer fake.limitMemoryMutex.RUnlock()
return fake.limitMemoryArgsForCall[i].handle, fake.limitMemoryArgsForCall[i].limit
}
func (fake *FakeConnection) LimitMemoryReturns(result1 api.MemoryLimits, result2 error) {
fake.limitMemoryReturns = struct {
result1 api.MemoryLimits
result2 error
}{result1, result2}
}
func (fake *FakeConnection) CurrentBandwidthLimits(handle string) (api.BandwidthLimits, error) {
fake.currentBandwidthLimitsMutex.Lock()
defer fake.currentBandwidthLimitsMutex.Unlock()
fake.currentBandwidthLimitsArgsForCall = append(fake.currentBandwidthLimitsArgsForCall, struct {
handle string
}{handle})
if fake.CurrentBandwidthLimitsStub != nil {
return fake.CurrentBandwidthLimitsStub(handle)
} else {
return fake.currentBandwidthLimitsReturns.result1, fake.currentBandwidthLimitsReturns.result2
}
}
func (fake *FakeConnection) CurrentBandwidthLimitsCallCount() int {
fake.currentBandwidthLimitsMutex.RLock()
defer fake.currentBandwidthLimitsMutex.RUnlock()
return len(fake.currentBandwidthLimitsArgsForCall)
}
func (fake *FakeConnection) CurrentBandwidthLimitsArgsForCall(i int) string {
fake.currentBandwidthLimitsMutex.RLock()
defer fake.currentBandwidthLimitsMutex.RUnlock()
return fake.currentBandwidthLimitsArgsForCall[i].handle
}
func (fake *FakeConnection) CurrentBandwidthLimitsReturns(result1 api.BandwidthLimits, result2 error) {
fake.currentBandwidthLimitsReturns = struct {
result1 api.BandwidthLimits
result2 error
}{result1, result2}
}
func (fake *FakeConnection) CurrentCPULimits(handle string) (api.CPULimits, error) {
fake.currentCPULimitsMutex.Lock()
defer fake.currentCPULimitsMutex.Unlock()
fake.currentCPULimitsArgsForCall = append(fake.currentCPULimitsArgsForCall, struct {
handle string
}{handle})
if fake.CurrentCPULimitsStub != nil {
return fake.CurrentCPULimitsStub(handle)
} else {
return fake.currentCPULimitsReturns.result1, fake.currentCPULimitsReturns.result2
}
}
func (fake *FakeConnection) CurrentCPULimitsCallCount() int {
fake.currentCPULimitsMutex.RLock()
defer fake.currentCPULimitsMutex.RUnlock()
return len(fake.currentCPULimitsArgsForCall)
}
func (fake *FakeConnection) CurrentCPULimitsArgsForCall(i int) string {
fake.currentCPULimitsMutex.RLock()
defer fake.currentCPULimitsMutex.RUnlock()
return fake.currentCPULimitsArgsForCall[i].handle
}
func (fake *FakeConnection) CurrentCPULimitsReturns(result1 api.CPULimits, result2 error) {
fake.currentCPULimitsReturns = struct {
result1 api.CPULimits
result2 error
}{result1, result2}
}
func (fake *FakeConnection) CurrentDiskLimits(handle string) (api.DiskLimits, error) {
fake.currentDiskLimitsMutex.Lock()
defer fake.currentDiskLimitsMutex.Unlock()
fake.currentDiskLimitsArgsForCall = append(fake.currentDiskLimitsArgsForCall, struct {
handle string
}{handle})
if fake.CurrentDiskLimitsStub != nil {
return fake.CurrentDiskLimitsStub(handle)
} else {
return fake.currentDiskLimitsReturns.result1, fake.currentDiskLimitsReturns.result2
}
}
func (fake *FakeConnection) CurrentDiskLimitsCallCount() int {
fake.currentDiskLimitsMutex.RLock()
defer fake.currentDiskLimitsMutex.RUnlock()
return len(fake.currentDiskLimitsArgsForCall)
}
func (fake *FakeConnection) CurrentDiskLimitsArgsForCall(i int) string {
fake.currentDiskLimitsMutex.RLock()
defer fake.currentDiskLimitsMutex.RUnlock()
return fake.currentDiskLimitsArgsForCall[i].handle
}
func (fake *FakeConnection) CurrentDiskLimitsReturns(result1 api.DiskLimits, result2 error) {
fake.currentDiskLimitsReturns = struct {
result1 api.DiskLimits
result2 error
}{result1, result2}
}
func (fake *FakeConnection) CurrentMemoryLimits(handle string) (api.MemoryLimits, error) {
fake.currentMemoryLimitsMutex.Lock()
defer fake.currentMemoryLimitsMutex.Unlock()
fake.currentMemoryLimitsArgsForCall = append(fake.currentMemoryLimitsArgsForCall, struct {
handle string
}{handle})
if fake.CurrentMemoryLimitsStub != nil {
return fake.CurrentMemoryLimitsStub(handle)
} else {
return fake.currentMemoryLimitsReturns.result1, fake.currentMemoryLimitsReturns.result2
}
}
func (fake *FakeConnection) CurrentMemoryLimitsCallCount() int {
fake.currentMemoryLimitsMutex.RLock()
defer fake.currentMemoryLimitsMutex.RUnlock()
return len(fake.currentMemoryLimitsArgsForCall)
}
func (fake *FakeConnection) CurrentMemoryLimitsArgsForCall(i int) string {
fake.currentMemoryLimitsMutex.RLock()
defer fake.currentMemoryLimitsMutex.RUnlock()
return fake.currentMemoryLimitsArgsForCall[i].handle
}
func (fake *FakeConnection) CurrentMemoryLimitsReturns(result1 api.MemoryLimits, result2 error) {
fake.currentMemoryLimitsReturns = struct {
result1 api.MemoryLimits
result2 error
}{result1, result2}
}
func (fake *FakeConnection) Run(handle string, spec api.ProcessSpec, io api.ProcessIO) (api.Process, error) {
fake.runMutex.Lock()
defer fake.runMutex.Unlock()
fake.runArgsForCall = append(fake.runArgsForCall, struct {
handle string
spec api.ProcessSpec
io api.ProcessIO
}{handle, spec, io})
if fake.RunStub != nil {
return fake.RunStub(handle, spec, io)
} else {
return fake.runReturns.result1, fake.runReturns.result2
}
}
func (fake *FakeConnection) RunCallCount() int {
fake.runMutex.RLock()
defer fake.runMutex.RUnlock()
return len(fake.runArgsForCall)
}
func (fake *FakeConnection) RunArgsForCall(i int) (string, api.ProcessSpec, api.ProcessIO) {
fake.runMutex.RLock()
defer fake.runMutex.RUnlock()
return fake.runArgsForCall[i].handle, fake.runArgsForCall[i].spec, fake.runArgsForCall[i].io
}
func (fake *FakeConnection) RunReturns(result1 api.Process, result2 error) {
fake.runReturns = struct {
result1 api.Process
result2 error
}{result1, result2}
}
func (fake *FakeConnection) Attach(handle string, processID uint32, io api.ProcessIO) (api.Process, error) {
fake.attachMutex.Lock()
defer fake.attachMutex.Unlock()
fake.attachArgsForCall = append(fake.attachArgsForCall, struct {
handle string
processID uint32
io api.ProcessIO
}{handle, processID, io})
if fake.AttachStub != nil {
return fake.AttachStub(handle, processID, io)
} else {
return fake.attachReturns.result1, fake.attachReturns.result2
}
}
func (fake *FakeConnection) AttachCallCount() int {
fake.attachMutex.RLock()
defer fake.attachMutex.RUnlock()
return len(fake.attachArgsForCall)
}
func (fake *FakeConnection) AttachArgsForCall(i int) (string, uint32, api.ProcessIO) {
fake.attachMutex.RLock()
defer fake.attachMutex.RUnlock()
return fake.attachArgsForCall[i].handle, fake.attachArgsForCall[i].processID, fake.attachArgsForCall[i].io
}
func (fake *FakeConnection) AttachReturns(result1 api.Process, result2 error) {
fake.attachReturns = struct {
result1 api.Process
result2 error
}{result1, result2}
}
func (fake *FakeConnection) NetIn(handle string, hostPort uint32, containerPort uint32) (uint32, uint32, error) {
fake.netInMutex.Lock()
defer fake.netInMutex.Unlock()
fake.netInArgsForCall = append(fake.netInArgsForCall, struct {
handle string
hostPort uint32
containerPort uint32
}{handle, hostPort, containerPort})
if fake.NetInStub != nil {
return fake.NetInStub(handle, hostPort, containerPort)
} else {
return fake.netInReturns.result1, fake.netInReturns.result2, fake.netInReturns.result3
}
}
func (fake *FakeConnection) NetInCallCount() int {
fake.netInMutex.RLock()
defer fake.netInMutex.RUnlock()
return len(fake.netInArgsForCall)
}
func (fake *FakeConnection) NetInArgsForCall(i int) (string, uint32, uint32) {
fake.netInMutex.RLock()
defer fake.netInMutex.RUnlock()
return fake.netInArgsForCall[i].handle, fake.netInArgsForCall[i].hostPort, fake.netInArgsForCall[i].containerPort
}
func (fake *FakeConnection) NetInReturns(result1 uint32, result2 uint32, result3 error) {
fake.netInReturns = struct {
result1 uint32
result2 uint32
result3 error
}{result1, result2, result3}
}
func (fake *FakeConnection) NetOut(handle string, network string, port uint32) error {
fake.netOutMutex.Lock()
defer fake.netOutMutex.Unlock()
fake.netOutArgsForCall = append(fake.netOutArgsForCall, struct {
handle string
network string
port uint32
}{handle, network, port})
if fake.NetOutStub != nil {
return fake.NetOutStub(handle, network, port)
} else {
return fake.netOutReturns.result1
}
}
func (fake *FakeConnection) NetOutCallCount() int {
fake.netOutMutex.RLock()
defer fake.netOutMutex.RUnlock()
return len(fake.netOutArgsForCall)
}
func (fake *FakeConnection) NetOutArgsForCall(i int) (string, string, uint32) {
fake.netOutMutex.RLock()
defer fake.netOutMutex.RUnlock()
return fake.netOutArgsForCall[i].handle, fake.netOutArgsForCall[i].network, fake.netOutArgsForCall[i].port
}
func (fake *FakeConnection) NetOutReturns(result1 error) {
fake.netOutReturns = struct {
result1 error
}{result1}
}
var _ Connection = new(FakeConnection)