v2.7.0 fac7705

mock_blob_storage.go RawHistoryFolder

1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8	"io"
9
10	mock "github.com/stretchr/testify/mock"
11)
12
13// NewMockBlobStorage creates a new instance of MockBlobStorage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
14// The first argument is typically a *testing.T value.
15func NewMockBlobStorage(t interface {
16	mock.TestingT
17	Cleanup(func())
18}) *MockBlobStorage {
19	mock := &MockBlobStorage{}
20	mock.Mock.Test(t)
21
22	t.Cleanup(func() { mock.AssertExpectations(t) })
23
24	return mock
25}
26
27// MockBlobStorage is an autogenerated mock type for the BlobStorage type
28type MockBlobStorage struct {
29	mock.Mock
30}
31
32type MockBlobStorage_Expecter struct {
33	mock *mock.Mock
34}
35
36func (_m *MockBlobStorage) EXPECT() *MockBlobStorage_Expecter {
37	return &MockBlobStorage_Expecter{mock: &_m.Mock}
38}
39
40// AppendBlobChunk provides a mock function for the type MockBlobStorage
41func (_mock *MockBlobStorage) AppendBlobChunk(name string, uuid string, chunk []byte) (int64, error) {
42	ret := _mock.Called(name, uuid, chunk)
43
44	if len(ret) == 0 {
45		panic("no return value specified for AppendBlobChunk")
46	}
47
48	var r0 int64
49	var r1 error
50	if returnFunc, ok := ret.Get(0).(func(string, string, []byte) (int64, error)); ok {
51		return returnFunc(name, uuid, chunk)
52	}
53	if returnFunc, ok := ret.Get(0).(func(string, string, []byte) int64); ok {
54		r0 = returnFunc(name, uuid, chunk)
55	} else {
56		r0 = ret.Get(0).(int64)
57	}
58	if returnFunc, ok := ret.Get(1).(func(string, string, []byte) error); ok {
59		r1 = returnFunc(name, uuid, chunk)
60	} else {
61		r1 = ret.Error(1)
62	}
63	return r0, r1
64}
65
66// MockBlobStorage_AppendBlobChunk_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AppendBlobChunk'
67type MockBlobStorage_AppendBlobChunk_Call struct {
68	*mock.Call
69}
70
71// AppendBlobChunk is a helper method to define mock.On call
72//   - name string
73//   - uuid string
74//   - chunk []byte
75func (_e *MockBlobStorage_Expecter) AppendBlobChunk(name interface{}, uuid interface{}, chunk interface{}) *MockBlobStorage_AppendBlobChunk_Call {
76	return &MockBlobStorage_AppendBlobChunk_Call{Call: _e.mock.On("AppendBlobChunk", name, uuid, chunk)}
77}
78
79func (_c *MockBlobStorage_AppendBlobChunk_Call) Run(run func(name string, uuid string, chunk []byte)) *MockBlobStorage_AppendBlobChunk_Call {
80	_c.Call.Run(func(args mock.Arguments) {
81		var arg0 string
82		if args[0] != nil {
83			arg0 = args[0].(string)
84		}
85		var arg1 string
86		if args[1] != nil {
87			arg1 = args[1].(string)
88		}
89		var arg2 []byte
90		if args[2] != nil {
91			arg2 = args[2].([]byte)
92		}
93		run(
94			arg0,
95			arg1,
96			arg2,
97		)
98	})
99	return _c
100}
101
102func (_c *MockBlobStorage_AppendBlobChunk_Call) Return(n int64, err error) *MockBlobStorage_AppendBlobChunk_Call {
103	_c.Call.Return(n, err)
104	return _c
105}
106
107func (_c *MockBlobStorage_AppendBlobChunk_Call) RunAndReturn(run func(name string, uuid string, chunk []byte) (int64, error)) *MockBlobStorage_AppendBlobChunk_Call {
108	_c.Call.Return(run)
109	return _c
110}
111
112// BlobExists provides a mock function for the type MockBlobStorage
113func (_mock *MockBlobStorage) BlobExists(digest string) bool {
114	ret := _mock.Called(digest)
115
116	if len(ret) == 0 {
117		panic("no return value specified for BlobExists")
118	}
119
120	var r0 bool
121	if returnFunc, ok := ret.Get(0).(func(string) bool); ok {
122		r0 = returnFunc(digest)
123	} else {
124		r0 = ret.Get(0).(bool)
125	}
126	return r0
127}
128
129// MockBlobStorage_BlobExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlobExists'
130type MockBlobStorage_BlobExists_Call struct {
131	*mock.Call
132}
133
134// BlobExists is a helper method to define mock.On call
135//   - digest string
136func (_e *MockBlobStorage_Expecter) BlobExists(digest interface{}) *MockBlobStorage_BlobExists_Call {
137	return &MockBlobStorage_BlobExists_Call{Call: _e.mock.On("BlobExists", digest)}
138}
139
140func (_c *MockBlobStorage_BlobExists_Call) Run(run func(digest string)) *MockBlobStorage_BlobExists_Call {
141	_c.Call.Run(func(args mock.Arguments) {
142		var arg0 string
143		if args[0] != nil {
144			arg0 = args[0].(string)
145		}
146		run(
147			arg0,
148		)
149	})
150	return _c
151}
152
153func (_c *MockBlobStorage_BlobExists_Call) Return(b bool) *MockBlobStorage_BlobExists_Call {
154	_c.Call.Return(b)
155	return _c
156}
157
158func (_c *MockBlobStorage_BlobExists_Call) RunAndReturn(run func(digest string) bool) *MockBlobStorage_BlobExists_Call {
159	_c.Call.Return(run)
160	return _c
161}
162
163// CancelBlobUpload provides a mock function for the type MockBlobStorage
164func (_mock *MockBlobStorage) CancelBlobUpload(uuid string) error {
165	ret := _mock.Called(uuid)
166
167	if len(ret) == 0 {
168		panic("no return value specified for CancelBlobUpload")
169	}
170
171	var r0 error
172	if returnFunc, ok := ret.Get(0).(func(string) error); ok {
173		r0 = returnFunc(uuid)
174	} else {
175		r0 = ret.Error(0)
176	}
177	return r0
178}
179
180// MockBlobStorage_CancelBlobUpload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelBlobUpload'
181type MockBlobStorage_CancelBlobUpload_Call struct {
182	*mock.Call
183}
184
185// CancelBlobUpload is a helper method to define mock.On call
186//   - uuid string
187func (_e *MockBlobStorage_Expecter) CancelBlobUpload(uuid interface{}) *MockBlobStorage_CancelBlobUpload_Call {
188	return &MockBlobStorage_CancelBlobUpload_Call{Call: _e.mock.On("CancelBlobUpload", uuid)}
189}
190
191func (_c *MockBlobStorage_CancelBlobUpload_Call) Run(run func(uuid string)) *MockBlobStorage_CancelBlobUpload_Call {
192	_c.Call.Run(func(args mock.Arguments) {
193		var arg0 string
194		if args[0] != nil {
195			arg0 = args[0].(string)
196		}
197		run(
198			arg0,
199		)
200	})
201	return _c
202}
203
204func (_c *MockBlobStorage_CancelBlobUpload_Call) Return(err error) *MockBlobStorage_CancelBlobUpload_Call {
205	_c.Call.Return(err)
206	return _c
207}
208
209func (_c *MockBlobStorage_CancelBlobUpload_Call) RunAndReturn(run func(uuid string) error) *MockBlobStorage_CancelBlobUpload_Call {
210	_c.Call.Return(run)
211	return _c
212}
213
214// DeleteBlob provides a mock function for the type MockBlobStorage
215func (_mock *MockBlobStorage) DeleteBlob(digest string) error {
216	ret := _mock.Called(digest)
217
218	if len(ret) == 0 {
219		panic("no return value specified for DeleteBlob")
220	}
221
222	var r0 error
223	if returnFunc, ok := ret.Get(0).(func(string) error); ok {
224		r0 = returnFunc(digest)
225	} else {
226		r0 = ret.Error(0)
227	}
228	return r0
229}
230
231// MockBlobStorage_DeleteBlob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteBlob'
232type MockBlobStorage_DeleteBlob_Call struct {
233	*mock.Call
234}
235
236// DeleteBlob is a helper method to define mock.On call
237//   - digest string
238func (_e *MockBlobStorage_Expecter) DeleteBlob(digest interface{}) *MockBlobStorage_DeleteBlob_Call {
239	return &MockBlobStorage_DeleteBlob_Call{Call: _e.mock.On("DeleteBlob", digest)}
240}
241
242func (_c *MockBlobStorage_DeleteBlob_Call) Run(run func(digest string)) *MockBlobStorage_DeleteBlob_Call {
243	_c.Call.Run(func(args mock.Arguments) {
244		var arg0 string
245		if args[0] != nil {
246			arg0 = args[0].(string)
247		}
248		run(
249			arg0,
250		)
251	})
252	return _c
253}
254
255func (_c *MockBlobStorage_DeleteBlob_Call) Return(err error) *MockBlobStorage_DeleteBlob_Call {
256	_c.Call.Return(err)
257	return _c
258}
259
260func (_c *MockBlobStorage_DeleteBlob_Call) RunAndReturn(run func(digest string) error) *MockBlobStorage_DeleteBlob_Call {
261	_c.Call.Return(run)
262	return _c
263}
264
265// FinishBlobUpload provides a mock function for the type MockBlobStorage
266func (_mock *MockBlobStorage) FinishBlobUpload(uuid string, digest string) error {
267	ret := _mock.Called(uuid, digest)
268
269	if len(ret) == 0 {
270		panic("no return value specified for FinishBlobUpload")
271	}
272
273	var r0 error
274	if returnFunc, ok := ret.Get(0).(func(string, string) error); ok {
275		r0 = returnFunc(uuid, digest)
276	} else {
277		r0 = ret.Error(0)
278	}
279	return r0
280}
281
282// MockBlobStorage_FinishBlobUpload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinishBlobUpload'
283type MockBlobStorage_FinishBlobUpload_Call struct {
284	*mock.Call
285}
286
287// FinishBlobUpload is a helper method to define mock.On call
288//   - uuid string
289//   - digest string
290func (_e *MockBlobStorage_Expecter) FinishBlobUpload(uuid interface{}, digest interface{}) *MockBlobStorage_FinishBlobUpload_Call {
291	return &MockBlobStorage_FinishBlobUpload_Call{Call: _e.mock.On("FinishBlobUpload", uuid, digest)}
292}
293
294func (_c *MockBlobStorage_FinishBlobUpload_Call) Run(run func(uuid string, digest string)) *MockBlobStorage_FinishBlobUpload_Call {
295	_c.Call.Run(func(args mock.Arguments) {
296		var arg0 string
297		if args[0] != nil {
298			arg0 = args[0].(string)
299		}
300		var arg1 string
301		if args[1] != nil {
302			arg1 = args[1].(string)
303		}
304		run(
305			arg0,
306			arg1,
307		)
308	})
309	return _c
310}
311
312func (_c *MockBlobStorage_FinishBlobUpload_Call) Return(err error) *MockBlobStorage_FinishBlobUpload_Call {
313	_c.Call.Return(err)
314	return _c
315}
316
317func (_c *MockBlobStorage_FinishBlobUpload_Call) RunAndReturn(run func(uuid string, digest string) error) *MockBlobStorage_FinishBlobUpload_Call {
318	_c.Call.Return(run)
319	return _c
320}
321
322// GetBlob provides a mock function for the type MockBlobStorage
323func (_mock *MockBlobStorage) GetBlob(digest string) (io.ReadCloser, error) {
324	ret := _mock.Called(digest)
325
326	if len(ret) == 0 {
327		panic("no return value specified for GetBlob")
328	}
329
330	var r0 io.ReadCloser
331	var r1 error
332	if returnFunc, ok := ret.Get(0).(func(string) (io.ReadCloser, error)); ok {
333		return returnFunc(digest)
334	}
335	if returnFunc, ok := ret.Get(0).(func(string) io.ReadCloser); ok {
336		r0 = returnFunc(digest)
337	} else {
338		if ret.Get(0) != nil {
339			r0 = ret.Get(0).(io.ReadCloser)
340		}
341	}
342	if returnFunc, ok := ret.Get(1).(func(string) error); ok {
343		r1 = returnFunc(digest)
344	} else {
345		r1 = ret.Error(1)
346	}
347	return r0, r1
348}
349
350// MockBlobStorage_GetBlob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlob'
351type MockBlobStorage_GetBlob_Call struct {
352	*mock.Call
353}
354
355// GetBlob is a helper method to define mock.On call
356//   - digest string
357func (_e *MockBlobStorage_Expecter) GetBlob(digest interface{}) *MockBlobStorage_GetBlob_Call {
358	return &MockBlobStorage_GetBlob_Call{Call: _e.mock.On("GetBlob", digest)}
359}
360
361func (_c *MockBlobStorage_GetBlob_Call) Run(run func(digest string)) *MockBlobStorage_GetBlob_Call {
362	_c.Call.Run(func(args mock.Arguments) {
363		var arg0 string
364		if args[0] != nil {
365			arg0 = args[0].(string)
366		}
367		run(
368			arg0,
369		)
370	})
371	return _c
372}
373
374func (_c *MockBlobStorage_GetBlob_Call) Return(readCloser io.ReadCloser, err error) *MockBlobStorage_GetBlob_Call {
375	_c.Call.Return(readCloser, err)
376	return _c
377}
378
379func (_c *MockBlobStorage_GetBlob_Call) RunAndReturn(run func(digest string) (io.ReadCloser, error)) *MockBlobStorage_GetBlob_Call {
380	_c.Call.Return(run)
381	return _c
382}
383
384// GetBlobPath provides a mock function for the type MockBlobStorage
385func (_mock *MockBlobStorage) GetBlobPath(digest string) (string, error) {
386	ret := _mock.Called(digest)
387
388	if len(ret) == 0 {
389		panic("no return value specified for GetBlobPath")
390	}
391
392	var r0 string
393	var r1 error
394	if returnFunc, ok := ret.Get(0).(func(string) (string, error)); ok {
395		return returnFunc(digest)
396	}
397	if returnFunc, ok := ret.Get(0).(func(string) string); ok {
398		r0 = returnFunc(digest)
399	} else {
400		r0 = ret.Get(0).(string)
401	}
402	if returnFunc, ok := ret.Get(1).(func(string) error); ok {
403		r1 = returnFunc(digest)
404	} else {
405		r1 = ret.Error(1)
406	}
407	return r0, r1
408}
409
410// MockBlobStorage_GetBlobPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlobPath'
411type MockBlobStorage_GetBlobPath_Call struct {
412	*mock.Call
413}
414
415// GetBlobPath is a helper method to define mock.On call
416//   - digest string
417func (_e *MockBlobStorage_Expecter) GetBlobPath(digest interface{}) *MockBlobStorage_GetBlobPath_Call {
418	return &MockBlobStorage_GetBlobPath_Call{Call: _e.mock.On("GetBlobPath", digest)}
419}
420
421func (_c *MockBlobStorage_GetBlobPath_Call) Run(run func(digest string)) *MockBlobStorage_GetBlobPath_Call {
422	_c.Call.Run(func(args mock.Arguments) {
423		var arg0 string
424		if args[0] != nil {
425			arg0 = args[0].(string)
426		}
427		run(
428			arg0,
429		)
430	})
431	return _c
432}
433
434func (_c *MockBlobStorage_GetBlobPath_Call) Return(s string, err error) *MockBlobStorage_GetBlobPath_Call {
435	_c.Call.Return(s, err)
436	return _c
437}
438
439func (_c *MockBlobStorage_GetBlobPath_Call) RunAndReturn(run func(digest string) (string, error)) *MockBlobStorage_GetBlobPath_Call {
440	_c.Call.Return(run)
441	return _c
442}
443
444// GetBlobUpload provides a mock function for the type MockBlobStorage
445func (_mock *MockBlobStorage) GetBlobUpload(uuid string) (io.WriteCloser, error) {
446	ret := _mock.Called(uuid)
447
448	if len(ret) == 0 {
449		panic("no return value specified for GetBlobUpload")
450	}
451
452	var r0 io.WriteCloser
453	var r1 error
454	if returnFunc, ok := ret.Get(0).(func(string) (io.WriteCloser, error)); ok {
455		return returnFunc(uuid)
456	}
457	if returnFunc, ok := ret.Get(0).(func(string) io.WriteCloser); ok {
458		r0 = returnFunc(uuid)
459	} else {
460		if ret.Get(0) != nil {
461			r0 = ret.Get(0).(io.WriteCloser)
462		}
463	}
464	if returnFunc, ok := ret.Get(1).(func(string) error); ok {
465		r1 = returnFunc(uuid)
466	} else {
467		r1 = ret.Error(1)
468	}
469	return r0, r1
470}
471
472// MockBlobStorage_GetBlobUpload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlobUpload'
473type MockBlobStorage_GetBlobUpload_Call struct {
474	*mock.Call
475}
476
477// GetBlobUpload is a helper method to define mock.On call
478//   - uuid string
479func (_e *MockBlobStorage_Expecter) GetBlobUpload(uuid interface{}) *MockBlobStorage_GetBlobUpload_Call {
480	return &MockBlobStorage_GetBlobUpload_Call{Call: _e.mock.On("GetBlobUpload", uuid)}
481}
482
483func (_c *MockBlobStorage_GetBlobUpload_Call) Run(run func(uuid string)) *MockBlobStorage_GetBlobUpload_Call {
484	_c.Call.Run(func(args mock.Arguments) {
485		var arg0 string
486		if args[0] != nil {
487			arg0 = args[0].(string)
488		}
489		run(
490			arg0,
491		)
492	})
493	return _c
494}
495
496func (_c *MockBlobStorage_GetBlobUpload_Call) Return(writeCloser io.WriteCloser, err error) *MockBlobStorage_GetBlobUpload_Call {
497	_c.Call.Return(writeCloser, err)
498	return _c
499}
500
501func (_c *MockBlobStorage_GetBlobUpload_Call) RunAndReturn(run func(uuid string) (io.WriteCloser, error)) *MockBlobStorage_GetBlobUpload_Call {
502	_c.Call.Return(run)
503	return _c
504}
505
506// PutBlob provides a mock function for the type MockBlobStorage
507func (_mock *MockBlobStorage) PutBlob(digest string, data io.Reader, size int64) error {
508	ret := _mock.Called(digest, data, size)
509
510	if len(ret) == 0 {
511		panic("no return value specified for PutBlob")
512	}
513
514	var r0 error
515	if returnFunc, ok := ret.Get(0).(func(string, io.Reader, int64) error); ok {
516		r0 = returnFunc(digest, data, size)
517	} else {
518		r0 = ret.Error(0)
519	}
520	return r0
521}
522
523// MockBlobStorage_PutBlob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutBlob'
524type MockBlobStorage_PutBlob_Call struct {
525	*mock.Call
526}
527
528// PutBlob is a helper method to define mock.On call
529//   - digest string
530//   - data io.Reader
531//   - size int64
532func (_e *MockBlobStorage_Expecter) PutBlob(digest interface{}, data interface{}, size interface{}) *MockBlobStorage_PutBlob_Call {
533	return &MockBlobStorage_PutBlob_Call{Call: _e.mock.On("PutBlob", digest, data, size)}
534}
535
536func (_c *MockBlobStorage_PutBlob_Call) Run(run func(digest string, data io.Reader, size int64)) *MockBlobStorage_PutBlob_Call {
537	_c.Call.Run(func(args mock.Arguments) {
538		var arg0 string
539		if args[0] != nil {
540			arg0 = args[0].(string)
541		}
542		var arg1 io.Reader
543		if args[1] != nil {
544			arg1 = args[1].(io.Reader)
545		}
546		var arg2 int64
547		if args[2] != nil {
548			arg2 = args[2].(int64)
549		}
550		run(
551			arg0,
552			arg1,
553			arg2,
554		)
555	})
556	return _c
557}
558
559func (_c *MockBlobStorage_PutBlob_Call) Return(err error) *MockBlobStorage_PutBlob_Call {
560	_c.Call.Return(err)
561	return _c
562}
563
564func (_c *MockBlobStorage_PutBlob_Call) RunAndReturn(run func(digest string, data io.Reader, size int64) error) *MockBlobStorage_PutBlob_Call {
565	_c.Call.Return(run)
566	return _c
567}
568
569// StartBlobUpload provides a mock function for the type MockBlobStorage
570func (_mock *MockBlobStorage) StartBlobUpload(name string) (string, error) {
571	ret := _mock.Called(name)
572
573	if len(ret) == 0 {
574		panic("no return value specified for StartBlobUpload")
575	}
576
577	var r0 string
578	var r1 error
579	if returnFunc, ok := ret.Get(0).(func(string) (string, error)); ok {
580		return returnFunc(name)
581	}
582	if returnFunc, ok := ret.Get(0).(func(string) string); ok {
583		r0 = returnFunc(name)
584	} else {
585		r0 = ret.Get(0).(string)
586	}
587	if returnFunc, ok := ret.Get(1).(func(string) error); ok {
588		r1 = returnFunc(name)
589	} else {
590		r1 = ret.Error(1)
591	}
592	return r0, r1
593}
594
595// MockBlobStorage_StartBlobUpload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartBlobUpload'
596type MockBlobStorage_StartBlobUpload_Call struct {
597	*mock.Call
598}
599
600// StartBlobUpload is a helper method to define mock.On call
601//   - name string
602func (_e *MockBlobStorage_Expecter) StartBlobUpload(name interface{}) *MockBlobStorage_StartBlobUpload_Call {
603	return &MockBlobStorage_StartBlobUpload_Call{Call: _e.mock.On("StartBlobUpload", name)}
604}
605
606func (_c *MockBlobStorage_StartBlobUpload_Call) Run(run func(name string)) *MockBlobStorage_StartBlobUpload_Call {
607	_c.Call.Run(func(args mock.Arguments) {
608		var arg0 string
609		if args[0] != nil {
610			arg0 = args[0].(string)
611		}
612		run(
613			arg0,
614		)
615	})
616	return _c
617}
618
619func (_c *MockBlobStorage_StartBlobUpload_Call) Return(s string, err error) *MockBlobStorage_StartBlobUpload_Call {
620	_c.Call.Return(s, err)
621	return _c
622}
623
624func (_c *MockBlobStorage_StartBlobUpload_Call) RunAndReturn(run func(name string) (string, error)) *MockBlobStorage_StartBlobUpload_Call {
625	_c.Call.Return(run)
626	return _c
627}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close