v0.34.0 7c1886f

BlobStore.go RawHistoryFolder

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

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 2

Tags 45

↑↓ moveenter openesc close