-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathbackend.go
More file actions
761 lines (621 loc) · 22.3 KB
/
backend.go
File metadata and controls
761 lines (621 loc) · 22.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
/*
* Copyright 2024 The CNAI Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Code generated by mockery v2.53.3. DO NOT EDIT.
package backend
import (
backend "github.com/modelpack/modctl/pkg/backend"
config "github.com/modelpack/modctl/pkg/config"
context "context"
mock "github.com/stretchr/testify/mock"
)
// Backend is an autogenerated mock type for the Backend type
type Backend struct {
mock.Mock
}
type Backend_Expecter struct {
mock *mock.Mock
}
func (_m *Backend) EXPECT() *Backend_Expecter {
return &Backend_Expecter{mock: &_m.Mock}
}
// Attach provides a mock function with given fields: ctx, filepath, cfg
func (_m *Backend) Attach(ctx context.Context, filepath string, cfg *config.Attach) error {
ret := _m.Called(ctx, filepath, cfg)
if len(ret) == 0 {
panic("no return value specified for Attach")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, *config.Attach) error); ok {
r0 = rf(ctx, filepath, cfg)
} else {
r0 = ret.Error(0)
}
return r0
}
// Backend_Attach_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Attach'
type Backend_Attach_Call struct {
*mock.Call
}
// Attach is a helper method to define mock.On call
// - ctx context.Context
// - filepath string
// - cfg *config.Attach
func (_e *Backend_Expecter) Attach(ctx interface{}, filepath interface{}, cfg interface{}) *Backend_Attach_Call {
return &Backend_Attach_Call{Call: _e.mock.On("Attach", ctx, filepath, cfg)}
}
func (_c *Backend_Attach_Call) Run(run func(ctx context.Context, filepath string, cfg *config.Attach)) *Backend_Attach_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(*config.Attach))
})
return _c
}
func (_c *Backend_Attach_Call) Return(_a0 error) *Backend_Attach_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Backend_Attach_Call) RunAndReturn(run func(context.Context, string, *config.Attach) error) *Backend_Attach_Call {
_c.Call.Return(run)
return _c
}
// Build provides a mock function with given fields: ctx, modelfilePath, workDir, target, cfg
func (_m *Backend) Build(ctx context.Context, modelfilePath string, workDir string, target string, cfg *config.Build) error {
ret := _m.Called(ctx, modelfilePath, workDir, target, cfg)
if len(ret) == 0 {
panic("no return value specified for Build")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *config.Build) error); ok {
r0 = rf(ctx, modelfilePath, workDir, target, cfg)
} else {
r0 = ret.Error(0)
}
return r0
}
// Backend_Build_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Build'
type Backend_Build_Call struct {
*mock.Call
}
// Build is a helper method to define mock.On call
// - ctx context.Context
// - modelfilePath string
// - workDir string
// - target string
// - cfg *config.Build
func (_e *Backend_Expecter) Build(ctx interface{}, modelfilePath interface{}, workDir interface{}, target interface{}, cfg interface{}) *Backend_Build_Call {
return &Backend_Build_Call{Call: _e.mock.On("Build", ctx, modelfilePath, workDir, target, cfg)}
}
func (_c *Backend_Build_Call) Run(run func(ctx context.Context, modelfilePath string, workDir string, target string, cfg *config.Build)) *Backend_Build_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(*config.Build))
})
return _c
}
func (_c *Backend_Build_Call) Return(_a0 error) *Backend_Build_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Backend_Build_Call) RunAndReturn(run func(context.Context, string, string, string, *config.Build) error) *Backend_Build_Call {
_c.Call.Return(run)
return _c
}
// Extract provides a mock function with given fields: ctx, target, cfg
func (_m *Backend) Extract(ctx context.Context, target string, cfg *config.Extract) error {
ret := _m.Called(ctx, target, cfg)
if len(ret) == 0 {
panic("no return value specified for Extract")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, *config.Extract) error); ok {
r0 = rf(ctx, target, cfg)
} else {
r0 = ret.Error(0)
}
return r0
}
// Backend_Extract_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Extract'
type Backend_Extract_Call struct {
*mock.Call
}
// Extract is a helper method to define mock.On call
// - ctx context.Context
// - target string
// - cfg *config.Extract
func (_e *Backend_Expecter) Extract(ctx interface{}, target interface{}, cfg interface{}) *Backend_Extract_Call {
return &Backend_Extract_Call{Call: _e.mock.On("Extract", ctx, target, cfg)}
}
func (_c *Backend_Extract_Call) Run(run func(ctx context.Context, target string, cfg *config.Extract)) *Backend_Extract_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(*config.Extract))
})
return _c
}
func (_c *Backend_Extract_Call) Return(_a0 error) *Backend_Extract_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Backend_Extract_Call) RunAndReturn(run func(context.Context, string, *config.Extract) error) *Backend_Extract_Call {
_c.Call.Return(run)
return _c
}
// Fetch provides a mock function with given fields: ctx, target, cfg
func (_m *Backend) Fetch(ctx context.Context, target string, cfg *config.Fetch) error {
ret := _m.Called(ctx, target, cfg)
if len(ret) == 0 {
panic("no return value specified for Fetch")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, *config.Fetch) error); ok {
r0 = rf(ctx, target, cfg)
} else {
r0 = ret.Error(0)
}
return r0
}
// Backend_Fetch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fetch'
type Backend_Fetch_Call struct {
*mock.Call
}
// Fetch is a helper method to define mock.On call
// - ctx context.Context
// - target string
// - cfg *config.Fetch
func (_e *Backend_Expecter) Fetch(ctx interface{}, target interface{}, cfg interface{}) *Backend_Fetch_Call {
return &Backend_Fetch_Call{Call: _e.mock.On("Fetch", ctx, target, cfg)}
}
func (_c *Backend_Fetch_Call) Run(run func(ctx context.Context, target string, cfg *config.Fetch)) *Backend_Fetch_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(*config.Fetch))
})
return _c
}
func (_c *Backend_Fetch_Call) Return(_a0 error) *Backend_Fetch_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Backend_Fetch_Call) RunAndReturn(run func(context.Context, string, *config.Fetch) error) *Backend_Fetch_Call {
_c.Call.Return(run)
return _c
}
// Inspect provides a mock function with given fields: ctx, target, cfg
func (_m *Backend) Inspect(ctx context.Context, target string, cfg *config.Inspect) (interface{}, error) {
ret := _m.Called(ctx, target, cfg)
if len(ret) == 0 {
panic("no return value specified for Inspect")
}
var r0 interface{}
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, *config.Inspect) (interface{}, error)); ok {
return rf(ctx, target, cfg)
}
if rf, ok := ret.Get(0).(func(context.Context, string, *config.Inspect) interface{}); ok {
r0 = rf(ctx, target, cfg)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(interface{})
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, *config.Inspect) error); ok {
r1 = rf(ctx, target, cfg)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Backend_Inspect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Inspect'
type Backend_Inspect_Call struct {
*mock.Call
}
// Inspect is a helper method to define mock.On call
// - ctx context.Context
// - target string
// - cfg *config.Inspect
func (_e *Backend_Expecter) Inspect(ctx interface{}, target interface{}, cfg interface{}) *Backend_Inspect_Call {
return &Backend_Inspect_Call{Call: _e.mock.On("Inspect", ctx, target, cfg)}
}
func (_c *Backend_Inspect_Call) Run(run func(ctx context.Context, target string, cfg *config.Inspect)) *Backend_Inspect_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(*config.Inspect))
})
return _c
}
func (_c *Backend_Inspect_Call) Return(_a0 interface{}, _a1 error) *Backend_Inspect_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Backend_Inspect_Call) RunAndReturn(run func(context.Context, string, *config.Inspect) (interface{}, error)) *Backend_Inspect_Call {
_c.Call.Return(run)
return _c
}
// List provides a mock function with given fields: ctx
func (_m *Backend) List(ctx context.Context) ([]*backend.ModelArtifact, error) {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for List")
}
var r0 []*backend.ModelArtifact
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) ([]*backend.ModelArtifact, error)); ok {
return rf(ctx)
}
if rf, ok := ret.Get(0).(func(context.Context) []*backend.ModelArtifact); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*backend.ModelArtifact)
}
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Backend_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
type Backend_List_Call struct {
*mock.Call
}
// List is a helper method to define mock.On call
// - ctx context.Context
func (_e *Backend_Expecter) List(ctx interface{}) *Backend_List_Call {
return &Backend_List_Call{Call: _e.mock.On("List", ctx)}
}
func (_c *Backend_List_Call) Run(run func(ctx context.Context)) *Backend_List_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *Backend_List_Call) Return(_a0 []*backend.ModelArtifact, _a1 error) *Backend_List_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Backend_List_Call) RunAndReturn(run func(context.Context) ([]*backend.ModelArtifact, error)) *Backend_List_Call {
_c.Call.Return(run)
return _c
}
// Login provides a mock function with given fields: ctx, registry, username, password, cfg
func (_m *Backend) Login(ctx context.Context, registry string, username string, password string, cfg *config.Login) error {
ret := _m.Called(ctx, registry, username, password, cfg)
if len(ret) == 0 {
panic("no return value specified for Login")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *config.Login) error); ok {
r0 = rf(ctx, registry, username, password, cfg)
} else {
r0 = ret.Error(0)
}
return r0
}
// Backend_Login_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Login'
type Backend_Login_Call struct {
*mock.Call
}
// Login is a helper method to define mock.On call
// - ctx context.Context
// - registry string
// - username string
// - password string
// - cfg *config.Login
func (_e *Backend_Expecter) Login(ctx interface{}, registry interface{}, username interface{}, password interface{}, cfg interface{}) *Backend_Login_Call {
return &Backend_Login_Call{Call: _e.mock.On("Login", ctx, registry, username, password, cfg)}
}
func (_c *Backend_Login_Call) Run(run func(ctx context.Context, registry string, username string, password string, cfg *config.Login)) *Backend_Login_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(*config.Login))
})
return _c
}
func (_c *Backend_Login_Call) Return(_a0 error) *Backend_Login_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Backend_Login_Call) RunAndReturn(run func(context.Context, string, string, string, *config.Login) error) *Backend_Login_Call {
_c.Call.Return(run)
return _c
}
// Logout provides a mock function with given fields: ctx, registry
func (_m *Backend) Logout(ctx context.Context, registry string) error {
ret := _m.Called(ctx, registry)
if len(ret) == 0 {
panic("no return value specified for Logout")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, registry)
} else {
r0 = ret.Error(0)
}
return r0
}
// Backend_Logout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Logout'
type Backend_Logout_Call struct {
*mock.Call
}
// Logout is a helper method to define mock.On call
// - ctx context.Context
// - registry string
func (_e *Backend_Expecter) Logout(ctx interface{}, registry interface{}) *Backend_Logout_Call {
return &Backend_Logout_Call{Call: _e.mock.On("Logout", ctx, registry)}
}
func (_c *Backend_Logout_Call) Run(run func(ctx context.Context, registry string)) *Backend_Logout_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *Backend_Logout_Call) Return(_a0 error) *Backend_Logout_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Backend_Logout_Call) RunAndReturn(run func(context.Context, string) error) *Backend_Logout_Call {
_c.Call.Return(run)
return _c
}
// Prune provides a mock function with given fields: ctx, dryRun, removeUntagged
func (_m *Backend) Prune(ctx context.Context, dryRun bool, removeUntagged bool) error {
ret := _m.Called(ctx, dryRun, removeUntagged)
if len(ret) == 0 {
panic("no return value specified for Prune")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, bool, bool) error); ok {
r0 = rf(ctx, dryRun, removeUntagged)
} else {
r0 = ret.Error(0)
}
return r0
}
// Backend_Prune_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Prune'
type Backend_Prune_Call struct {
*mock.Call
}
// Prune is a helper method to define mock.On call
// - ctx context.Context
// - dryRun bool
// - removeUntagged bool
func (_e *Backend_Expecter) Prune(ctx interface{}, dryRun interface{}, removeUntagged interface{}) *Backend_Prune_Call {
return &Backend_Prune_Call{Call: _e.mock.On("Prune", ctx, dryRun, removeUntagged)}
}
func (_c *Backend_Prune_Call) Run(run func(ctx context.Context, dryRun bool, removeUntagged bool)) *Backend_Prune_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(bool), args[2].(bool))
})
return _c
}
func (_c *Backend_Prune_Call) Return(_a0 error) *Backend_Prune_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Backend_Prune_Call) RunAndReturn(run func(context.Context, bool, bool) error) *Backend_Prune_Call {
_c.Call.Return(run)
return _c
}
// Pull provides a mock function with given fields: ctx, target, cfg
func (_m *Backend) Pull(ctx context.Context, target string, cfg *config.Pull) error {
ret := _m.Called(ctx, target, cfg)
if len(ret) == 0 {
panic("no return value specified for Pull")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, *config.Pull) error); ok {
r0 = rf(ctx, target, cfg)
} else {
r0 = ret.Error(0)
}
return r0
}
// Backend_Pull_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pull'
type Backend_Pull_Call struct {
*mock.Call
}
// Pull is a helper method to define mock.On call
// - ctx context.Context
// - target string
// - cfg *config.Pull
func (_e *Backend_Expecter) Pull(ctx interface{}, target interface{}, cfg interface{}) *Backend_Pull_Call {
return &Backend_Pull_Call{Call: _e.mock.On("Pull", ctx, target, cfg)}
}
func (_c *Backend_Pull_Call) Run(run func(ctx context.Context, target string, cfg *config.Pull)) *Backend_Pull_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(*config.Pull))
})
return _c
}
func (_c *Backend_Pull_Call) Return(_a0 error) *Backend_Pull_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Backend_Pull_Call) RunAndReturn(run func(context.Context, string, *config.Pull) error) *Backend_Pull_Call {
_c.Call.Return(run)
return _c
}
// Push provides a mock function with given fields: ctx, target, cfg
func (_m *Backend) Push(ctx context.Context, target string, cfg *config.Push) error {
ret := _m.Called(ctx, target, cfg)
if len(ret) == 0 {
panic("no return value specified for Push")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, *config.Push) error); ok {
r0 = rf(ctx, target, cfg)
} else {
r0 = ret.Error(0)
}
return r0
}
// Backend_Push_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Push'
type Backend_Push_Call struct {
*mock.Call
}
// Push is a helper method to define mock.On call
// - ctx context.Context
// - target string
// - cfg *config.Push
func (_e *Backend_Expecter) Push(ctx interface{}, target interface{}, cfg interface{}) *Backend_Push_Call {
return &Backend_Push_Call{Call: _e.mock.On("Push", ctx, target, cfg)}
}
func (_c *Backend_Push_Call) Run(run func(ctx context.Context, target string, cfg *config.Push)) *Backend_Push_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(*config.Push))
})
return _c
}
func (_c *Backend_Push_Call) Return(_a0 error) *Backend_Push_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Backend_Push_Call) RunAndReturn(run func(context.Context, string, *config.Push) error) *Backend_Push_Call {
_c.Call.Return(run)
return _c
}
// Remove provides a mock function with given fields: ctx, target
func (_m *Backend) Remove(ctx context.Context, target string) (string, error) {
ret := _m.Called(ctx, target)
if len(ret) == 0 {
panic("no return value specified for Remove")
}
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok {
return rf(ctx, target)
}
if rf, ok := ret.Get(0).(func(context.Context, string) string); ok {
r0 = rf(ctx, target)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, target)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Backend_Remove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remove'
type Backend_Remove_Call struct {
*mock.Call
}
// Remove is a helper method to define mock.On call
// - ctx context.Context
// - target string
func (_e *Backend_Expecter) Remove(ctx interface{}, target interface{}) *Backend_Remove_Call {
return &Backend_Remove_Call{Call: _e.mock.On("Remove", ctx, target)}
}
func (_c *Backend_Remove_Call) Run(run func(ctx context.Context, target string)) *Backend_Remove_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *Backend_Remove_Call) Return(_a0 string, _a1 error) *Backend_Remove_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Backend_Remove_Call) RunAndReturn(run func(context.Context, string) (string, error)) *Backend_Remove_Call {
_c.Call.Return(run)
return _c
}
// Tag provides a mock function with given fields: ctx, source, target
func (_m *Backend) Tag(ctx context.Context, source string, target string) error {
ret := _m.Called(ctx, source, target)
if len(ret) == 0 {
panic("no return value specified for Tag")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
r0 = rf(ctx, source, target)
} else {
r0 = ret.Error(0)
}
return r0
}
// Backend_Tag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tag'
type Backend_Tag_Call struct {
*mock.Call
}
// Tag is a helper method to define mock.On call
// - ctx context.Context
// - source string
// - target string
func (_e *Backend_Expecter) Tag(ctx interface{}, source interface{}, target interface{}) *Backend_Tag_Call {
return &Backend_Tag_Call{Call: _e.mock.On("Tag", ctx, source, target)}
}
func (_c *Backend_Tag_Call) Run(run func(ctx context.Context, source string, target string)) *Backend_Tag_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(string))
})
return _c
}
func (_c *Backend_Tag_Call) Return(_a0 error) *Backend_Tag_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Backend_Tag_Call) RunAndReturn(run func(context.Context, string, string) error) *Backend_Tag_Call {
_c.Call.Return(run)
return _c
}
// Upload provides a mock function with given fields: ctx, filepath, cfg
func (_m *Backend) Upload(ctx context.Context, filepath string, cfg *config.Upload) error {
ret := _m.Called(ctx, filepath, cfg)
if len(ret) == 0 {
panic("no return value specified for Upload")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, *config.Upload) error); ok {
r0 = rf(ctx, filepath, cfg)
} else {
r0 = ret.Error(0)
}
return r0
}
// Backend_Upload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Upload'
type Backend_Upload_Call struct {
*mock.Call
}
// Upload is a helper method to define mock.On call
// - ctx context.Context
// - filepath string
// - cfg *config.Upload
func (_e *Backend_Expecter) Upload(ctx interface{}, filepath interface{}, cfg interface{}) *Backend_Upload_Call {
return &Backend_Upload_Call{Call: _e.mock.On("Upload", ctx, filepath, cfg)}
}
func (_c *Backend_Upload_Call) Run(run func(ctx context.Context, filepath string, cfg *config.Upload)) *Backend_Upload_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(*config.Upload))
})
return _c
}
func (_c *Backend_Upload_Call) Return(_a0 error) *Backend_Upload_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Backend_Upload_Call) RunAndReturn(run func(context.Context, string, *config.Upload) error) *Backend_Upload_Call {
_c.Call.Return(run)
return _c
}
// NewBackend creates a new instance of Backend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewBackend(t interface {
mock.TestingT
Cleanup(func())
}) *Backend {
mock := &Backend{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}