main 5041353

favorite.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
10	"github.com/bnema/dumber/internal/domain/entity"
11	mock "github.com/stretchr/testify/mock"
12)
13
14// NewMockFavoriteRepository creates a new instance of MockFavoriteRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
15// The first argument is typically a *testing.T value.
16func NewMockFavoriteRepository(t interface {
17	mock.TestingT
18	Cleanup(func())
19}) *MockFavoriteRepository {
20	mock := &MockFavoriteRepository{}
21	mock.Mock.Test(t)
22
23	t.Cleanup(func() { mock.AssertExpectations(t) })
24
25	return mock
26}
27
28// MockFavoriteRepository is an autogenerated mock type for the FavoriteRepository type
29type MockFavoriteRepository struct {
30	mock.Mock
31}
32
33type MockFavoriteRepository_Expecter struct {
34	mock *mock.Mock
35}
36
37func (_m *MockFavoriteRepository) EXPECT() *MockFavoriteRepository_Expecter {
38	return &MockFavoriteRepository_Expecter{mock: &_m.Mock}
39}
40
41// Delete provides a mock function for the type MockFavoriteRepository
42func (_mock *MockFavoriteRepository) Delete(ctx context.Context, id entity.FavoriteID) error {
43	ret := _mock.Called(ctx, id)
44
45	if len(ret) == 0 {
46		panic("no return value specified for Delete")
47	}
48
49	var r0 error
50	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) error); ok {
51		r0 = returnFunc(ctx, id)
52	} else {
53		r0 = ret.Error(0)
54	}
55	return r0
56}
57
58// MockFavoriteRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
59type MockFavoriteRepository_Delete_Call struct {
60	*mock.Call
61}
62
63// Delete is a helper method to define mock.On call
64//   - ctx context.Context
65//   - id entity.FavoriteID
66func (_e *MockFavoriteRepository_Expecter) Delete(ctx any, id any) *MockFavoriteRepository_Delete_Call {
67	return &MockFavoriteRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)}
68}
69
70func (_c *MockFavoriteRepository_Delete_Call) Run(run func(ctx context.Context, id entity.FavoriteID)) *MockFavoriteRepository_Delete_Call {
71	_c.Call.Run(func(args mock.Arguments) {
72		var arg0 context.Context
73		if args[0] != nil {
74			arg0 = args[0].(context.Context)
75		}
76		var arg1 entity.FavoriteID
77		if args[1] != nil {
78			arg1 = args[1].(entity.FavoriteID)
79		}
80		run(
81			arg0,
82			arg1,
83		)
84	})
85	return _c
86}
87
88func (_c *MockFavoriteRepository_Delete_Call) Return(err error) *MockFavoriteRepository_Delete_Call {
89	_c.Call.Return(err)
90	return _c
91}
92
93func (_c *MockFavoriteRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID) error) *MockFavoriteRepository_Delete_Call {
94	_c.Call.Return(run)
95	return _c
96}
97
98// FindByID provides a mock function for the type MockFavoriteRepository
99func (_mock *MockFavoriteRepository) FindByID(ctx context.Context, id entity.FavoriteID) (*entity.Favorite, error) {
100	ret := _mock.Called(ctx, id)
101
102	if len(ret) == 0 {
103		panic("no return value specified for FindByID")
104	}
105
106	var r0 *entity.Favorite
107	var r1 error
108	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) (*entity.Favorite, error)); ok {
109		return returnFunc(ctx, id)
110	}
111	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) *entity.Favorite); ok {
112		r0 = returnFunc(ctx, id)
113	} else {
114		if ret.Get(0) != nil {
115			r0 = ret.Get(0).(*entity.Favorite)
116		}
117	}
118	if returnFunc, ok := ret.Get(1).(func(context.Context, entity.FavoriteID) error); ok {
119		r1 = returnFunc(ctx, id)
120	} else {
121		r1 = ret.Error(1)
122	}
123	return r0, r1
124}
125
126// MockFavoriteRepository_FindByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByID'
127type MockFavoriteRepository_FindByID_Call struct {
128	*mock.Call
129}
130
131// FindByID is a helper method to define mock.On call
132//   - ctx context.Context
133//   - id entity.FavoriteID
134func (_e *MockFavoriteRepository_Expecter) FindByID(ctx any, id any) *MockFavoriteRepository_FindByID_Call {
135	return &MockFavoriteRepository_FindByID_Call{Call: _e.mock.On("FindByID", ctx, id)}
136}
137
138func (_c *MockFavoriteRepository_FindByID_Call) Run(run func(ctx context.Context, id entity.FavoriteID)) *MockFavoriteRepository_FindByID_Call {
139	_c.Call.Run(func(args mock.Arguments) {
140		var arg0 context.Context
141		if args[0] != nil {
142			arg0 = args[0].(context.Context)
143		}
144		var arg1 entity.FavoriteID
145		if args[1] != nil {
146			arg1 = args[1].(entity.FavoriteID)
147		}
148		run(
149			arg0,
150			arg1,
151		)
152	})
153	return _c
154}
155
156func (_c *MockFavoriteRepository_FindByID_Call) Return(favorite *entity.Favorite, err error) *MockFavoriteRepository_FindByID_Call {
157	_c.Call.Return(favorite, err)
158	return _c
159}
160
161func (_c *MockFavoriteRepository_FindByID_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID) (*entity.Favorite, error)) *MockFavoriteRepository_FindByID_Call {
162	_c.Call.Return(run)
163	return _c
164}
165
166// FindByURL provides a mock function for the type MockFavoriteRepository
167func (_mock *MockFavoriteRepository) FindByURL(ctx context.Context, url string) (*entity.Favorite, error) {
168	ret := _mock.Called(ctx, url)
169
170	if len(ret) == 0 {
171		panic("no return value specified for FindByURL")
172	}
173
174	var r0 *entity.Favorite
175	var r1 error
176	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*entity.Favorite, error)); ok {
177		return returnFunc(ctx, url)
178	}
179	if returnFunc, ok := ret.Get(0).(func(context.Context, string) *entity.Favorite); ok {
180		r0 = returnFunc(ctx, url)
181	} else {
182		if ret.Get(0) != nil {
183			r0 = ret.Get(0).(*entity.Favorite)
184		}
185	}
186	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
187		r1 = returnFunc(ctx, url)
188	} else {
189		r1 = ret.Error(1)
190	}
191	return r0, r1
192}
193
194// MockFavoriteRepository_FindByURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByURL'
195type MockFavoriteRepository_FindByURL_Call struct {
196	*mock.Call
197}
198
199// FindByURL is a helper method to define mock.On call
200//   - ctx context.Context
201//   - url string
202func (_e *MockFavoriteRepository_Expecter) FindByURL(ctx any, url any) *MockFavoriteRepository_FindByURL_Call {
203	return &MockFavoriteRepository_FindByURL_Call{Call: _e.mock.On("FindByURL", ctx, url)}
204}
205
206func (_c *MockFavoriteRepository_FindByURL_Call) Run(run func(ctx context.Context, url string)) *MockFavoriteRepository_FindByURL_Call {
207	_c.Call.Run(func(args mock.Arguments) {
208		var arg0 context.Context
209		if args[0] != nil {
210			arg0 = args[0].(context.Context)
211		}
212		var arg1 string
213		if args[1] != nil {
214			arg1 = args[1].(string)
215		}
216		run(
217			arg0,
218			arg1,
219		)
220	})
221	return _c
222}
223
224func (_c *MockFavoriteRepository_FindByURL_Call) Return(favorite *entity.Favorite, err error) *MockFavoriteRepository_FindByURL_Call {
225	_c.Call.Return(favorite, err)
226	return _c
227}
228
229func (_c *MockFavoriteRepository_FindByURL_Call) RunAndReturn(run func(ctx context.Context, url string) (*entity.Favorite, error)) *MockFavoriteRepository_FindByURL_Call {
230	_c.Call.Return(run)
231	return _c
232}
233
234// GetAll provides a mock function for the type MockFavoriteRepository
235func (_mock *MockFavoriteRepository) GetAll(ctx context.Context) ([]*entity.Favorite, error) {
236	ret := _mock.Called(ctx)
237
238	if len(ret) == 0 {
239		panic("no return value specified for GetAll")
240	}
241
242	var r0 []*entity.Favorite
243	var r1 error
244	if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.Favorite, error)); ok {
245		return returnFunc(ctx)
246	}
247	if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.Favorite); ok {
248		r0 = returnFunc(ctx)
249	} else {
250		if ret.Get(0) != nil {
251			r0 = ret.Get(0).([]*entity.Favorite)
252		}
253	}
254	if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
255		r1 = returnFunc(ctx)
256	} else {
257		r1 = ret.Error(1)
258	}
259	return r0, r1
260}
261
262// MockFavoriteRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll'
263type MockFavoriteRepository_GetAll_Call struct {
264	*mock.Call
265}
266
267// GetAll is a helper method to define mock.On call
268//   - ctx context.Context
269func (_e *MockFavoriteRepository_Expecter) GetAll(ctx any) *MockFavoriteRepository_GetAll_Call {
270	return &MockFavoriteRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx)}
271}
272
273func (_c *MockFavoriteRepository_GetAll_Call) Run(run func(ctx context.Context)) *MockFavoriteRepository_GetAll_Call {
274	_c.Call.Run(func(args mock.Arguments) {
275		var arg0 context.Context
276		if args[0] != nil {
277			arg0 = args[0].(context.Context)
278		}
279		run(
280			arg0,
281		)
282	})
283	return _c
284}
285
286func (_c *MockFavoriteRepository_GetAll_Call) Return(favorites []*entity.Favorite, err error) *MockFavoriteRepository_GetAll_Call {
287	_c.Call.Return(favorites, err)
288	return _c
289}
290
291func (_c *MockFavoriteRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.Favorite, error)) *MockFavoriteRepository_GetAll_Call {
292	_c.Call.Return(run)
293	return _c
294}
295
296// GetByShortcut provides a mock function for the type MockFavoriteRepository
297func (_mock *MockFavoriteRepository) GetByShortcut(ctx context.Context, key int) (*entity.Favorite, error) {
298	ret := _mock.Called(ctx, key)
299
300	if len(ret) == 0 {
301		panic("no return value specified for GetByShortcut")
302	}
303
304	var r0 *entity.Favorite
305	var r1 error
306	if returnFunc, ok := ret.Get(0).(func(context.Context, int) (*entity.Favorite, error)); ok {
307		return returnFunc(ctx, key)
308	}
309	if returnFunc, ok := ret.Get(0).(func(context.Context, int) *entity.Favorite); ok {
310		r0 = returnFunc(ctx, key)
311	} else {
312		if ret.Get(0) != nil {
313			r0 = ret.Get(0).(*entity.Favorite)
314		}
315	}
316	if returnFunc, ok := ret.Get(1).(func(context.Context, int) error); ok {
317		r1 = returnFunc(ctx, key)
318	} else {
319		r1 = ret.Error(1)
320	}
321	return r0, r1
322}
323
324// MockFavoriteRepository_GetByShortcut_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByShortcut'
325type MockFavoriteRepository_GetByShortcut_Call struct {
326	*mock.Call
327}
328
329// GetByShortcut is a helper method to define mock.On call
330//   - ctx context.Context
331//   - key int
332func (_e *MockFavoriteRepository_Expecter) GetByShortcut(ctx any, key any) *MockFavoriteRepository_GetByShortcut_Call {
333	return &MockFavoriteRepository_GetByShortcut_Call{Call: _e.mock.On("GetByShortcut", ctx, key)}
334}
335
336func (_c *MockFavoriteRepository_GetByShortcut_Call) Run(run func(ctx context.Context, key int)) *MockFavoriteRepository_GetByShortcut_Call {
337	_c.Call.Run(func(args mock.Arguments) {
338		var arg0 context.Context
339		if args[0] != nil {
340			arg0 = args[0].(context.Context)
341		}
342		var arg1 int
343		if args[1] != nil {
344			arg1 = args[1].(int)
345		}
346		run(
347			arg0,
348			arg1,
349		)
350	})
351	return _c
352}
353
354func (_c *MockFavoriteRepository_GetByShortcut_Call) Return(favorite *entity.Favorite, err error) *MockFavoriteRepository_GetByShortcut_Call {
355	_c.Call.Return(favorite, err)
356	return _c
357}
358
359func (_c *MockFavoriteRepository_GetByShortcut_Call) RunAndReturn(run func(ctx context.Context, key int) (*entity.Favorite, error)) *MockFavoriteRepository_GetByShortcut_Call {
360	_c.Call.Return(run)
361	return _c
362}
363
364// GetByTag provides a mock function for the type MockFavoriteRepository
365func (_mock *MockFavoriteRepository) GetByTag(ctx context.Context, tagID entity.TagID) ([]*entity.Favorite, error) {
366	ret := _mock.Called(ctx, tagID)
367
368	if len(ret) == 0 {
369		panic("no return value specified for GetByTag")
370	}
371
372	var r0 []*entity.Favorite
373	var r1 error
374	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID) ([]*entity.Favorite, error)); ok {
375		return returnFunc(ctx, tagID)
376	}
377	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID) []*entity.Favorite); ok {
378		r0 = returnFunc(ctx, tagID)
379	} else {
380		if ret.Get(0) != nil {
381			r0 = ret.Get(0).([]*entity.Favorite)
382		}
383	}
384	if returnFunc, ok := ret.Get(1).(func(context.Context, entity.TagID) error); ok {
385		r1 = returnFunc(ctx, tagID)
386	} else {
387		r1 = ret.Error(1)
388	}
389	return r0, r1
390}
391
392// MockFavoriteRepository_GetByTag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByTag'
393type MockFavoriteRepository_GetByTag_Call struct {
394	*mock.Call
395}
396
397// GetByTag is a helper method to define mock.On call
398//   - ctx context.Context
399//   - tagID entity.TagID
400func (_e *MockFavoriteRepository_Expecter) GetByTag(ctx any, tagID any) *MockFavoriteRepository_GetByTag_Call {
401	return &MockFavoriteRepository_GetByTag_Call{Call: _e.mock.On("GetByTag", ctx, tagID)}
402}
403
404func (_c *MockFavoriteRepository_GetByTag_Call) Run(run func(ctx context.Context, tagID entity.TagID)) *MockFavoriteRepository_GetByTag_Call {
405	_c.Call.Run(func(args mock.Arguments) {
406		var arg0 context.Context
407		if args[0] != nil {
408			arg0 = args[0].(context.Context)
409		}
410		var arg1 entity.TagID
411		if args[1] != nil {
412			arg1 = args[1].(entity.TagID)
413		}
414		run(
415			arg0,
416			arg1,
417		)
418	})
419	return _c
420}
421
422func (_c *MockFavoriteRepository_GetByTag_Call) Return(favorites []*entity.Favorite, err error) *MockFavoriteRepository_GetByTag_Call {
423	_c.Call.Return(favorites, err)
424	return _c
425}
426
427func (_c *MockFavoriteRepository_GetByTag_Call) RunAndReturn(run func(ctx context.Context, tagID entity.TagID) ([]*entity.Favorite, error)) *MockFavoriteRepository_GetByTag_Call {
428	_c.Call.Return(run)
429	return _c
430}
431
432// Save provides a mock function for the type MockFavoriteRepository
433func (_mock *MockFavoriteRepository) Save(ctx context.Context, fav *entity.Favorite) error {
434	ret := _mock.Called(ctx, fav)
435
436	if len(ret) == 0 {
437		panic("no return value specified for Save")
438	}
439
440	var r0 error
441	if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.Favorite) error); ok {
442		r0 = returnFunc(ctx, fav)
443	} else {
444		r0 = ret.Error(0)
445	}
446	return r0
447}
448
449// MockFavoriteRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save'
450type MockFavoriteRepository_Save_Call struct {
451	*mock.Call
452}
453
454// Save is a helper method to define mock.On call
455//   - ctx context.Context
456//   - fav *entity.Favorite
457func (_e *MockFavoriteRepository_Expecter) Save(ctx any, fav any) *MockFavoriteRepository_Save_Call {
458	return &MockFavoriteRepository_Save_Call{Call: _e.mock.On("Save", ctx, fav)}
459}
460
461func (_c *MockFavoriteRepository_Save_Call) Run(run func(ctx context.Context, fav *entity.Favorite)) *MockFavoriteRepository_Save_Call {
462	_c.Call.Run(func(args mock.Arguments) {
463		var arg0 context.Context
464		if args[0] != nil {
465			arg0 = args[0].(context.Context)
466		}
467		var arg1 *entity.Favorite
468		if args[1] != nil {
469			arg1 = args[1].(*entity.Favorite)
470		}
471		run(
472			arg0,
473			arg1,
474		)
475	})
476	return _c
477}
478
479func (_c *MockFavoriteRepository_Save_Call) Return(err error) *MockFavoriteRepository_Save_Call {
480	_c.Call.Return(err)
481	return _c
482}
483
484func (_c *MockFavoriteRepository_Save_Call) RunAndReturn(run func(ctx context.Context, fav *entity.Favorite) error) *MockFavoriteRepository_Save_Call {
485	_c.Call.Return(run)
486	return _c
487}
488
489// SetShortcut provides a mock function for the type MockFavoriteRepository
490func (_mock *MockFavoriteRepository) SetShortcut(ctx context.Context, id entity.FavoriteID, key *int) error {
491	ret := _mock.Called(ctx, id, key)
492
493	if len(ret) == 0 {
494		panic("no return value specified for SetShortcut")
495	}
496
497	var r0 error
498	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID, *int) error); ok {
499		r0 = returnFunc(ctx, id, key)
500	} else {
501		r0 = ret.Error(0)
502	}
503	return r0
504}
505
506// MockFavoriteRepository_SetShortcut_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetShortcut'
507type MockFavoriteRepository_SetShortcut_Call struct {
508	*mock.Call
509}
510
511// SetShortcut is a helper method to define mock.On call
512//   - ctx context.Context
513//   - id entity.FavoriteID
514//   - key *int
515func (_e *MockFavoriteRepository_Expecter) SetShortcut(ctx any, id any, key any) *MockFavoriteRepository_SetShortcut_Call {
516	return &MockFavoriteRepository_SetShortcut_Call{Call: _e.mock.On("SetShortcut", ctx, id, key)}
517}
518
519func (_c *MockFavoriteRepository_SetShortcut_Call) Run(run func(ctx context.Context, id entity.FavoriteID, key *int)) *MockFavoriteRepository_SetShortcut_Call {
520	_c.Call.Run(func(args mock.Arguments) {
521		var arg0 context.Context
522		if args[0] != nil {
523			arg0 = args[0].(context.Context)
524		}
525		var arg1 entity.FavoriteID
526		if args[1] != nil {
527			arg1 = args[1].(entity.FavoriteID)
528		}
529		var arg2 *int
530		if args[2] != nil {
531			arg2 = args[2].(*int)
532		}
533		run(
534			arg0,
535			arg1,
536			arg2,
537		)
538	})
539	return _c
540}
541
542func (_c *MockFavoriteRepository_SetShortcut_Call) Return(err error) *MockFavoriteRepository_SetShortcut_Call {
543	_c.Call.Return(err)
544	return _c
545}
546
547func (_c *MockFavoriteRepository_SetShortcut_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID, key *int) error) *MockFavoriteRepository_SetShortcut_Call {
548	_c.Call.Return(run)
549	return _c
550}
551
552// UpdatePosition provides a mock function for the type MockFavoriteRepository
553func (_mock *MockFavoriteRepository) UpdatePosition(ctx context.Context, id entity.FavoriteID, position int) error {
554	ret := _mock.Called(ctx, id, position)
555
556	if len(ret) == 0 {
557		panic("no return value specified for UpdatePosition")
558	}
559
560	var r0 error
561	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID, int) error); ok {
562		r0 = returnFunc(ctx, id, position)
563	} else {
564		r0 = ret.Error(0)
565	}
566	return r0
567}
568
569// MockFavoriteRepository_UpdatePosition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePosition'
570type MockFavoriteRepository_UpdatePosition_Call struct {
571	*mock.Call
572}
573
574// UpdatePosition is a helper method to define mock.On call
575//   - ctx context.Context
576//   - id entity.FavoriteID
577//   - position int
578func (_e *MockFavoriteRepository_Expecter) UpdatePosition(ctx any, id any, position any) *MockFavoriteRepository_UpdatePosition_Call {
579	return &MockFavoriteRepository_UpdatePosition_Call{Call: _e.mock.On("UpdatePosition", ctx, id, position)}
580}
581
582func (_c *MockFavoriteRepository_UpdatePosition_Call) Run(run func(ctx context.Context, id entity.FavoriteID, position int)) *MockFavoriteRepository_UpdatePosition_Call {
583	_c.Call.Run(func(args mock.Arguments) {
584		var arg0 context.Context
585		if args[0] != nil {
586			arg0 = args[0].(context.Context)
587		}
588		var arg1 entity.FavoriteID
589		if args[1] != nil {
590			arg1 = args[1].(entity.FavoriteID)
591		}
592		var arg2 int
593		if args[2] != nil {
594			arg2 = args[2].(int)
595		}
596		run(
597			arg0,
598			arg1,
599			arg2,
600		)
601	})
602	return _c
603}
604
605func (_c *MockFavoriteRepository_UpdatePosition_Call) Return(err error) *MockFavoriteRepository_UpdatePosition_Call {
606	_c.Call.Return(err)
607	return _c
608}
609
610func (_c *MockFavoriteRepository_UpdatePosition_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID, position int) error) *MockFavoriteRepository_UpdatePosition_Call {
611	_c.Call.Return(run)
612	return _c
613}
614
615// NewMockTagRepository creates a new instance of MockTagRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
616// The first argument is typically a *testing.T value.
617func NewMockTagRepository(t interface {
618	mock.TestingT
619	Cleanup(func())
620}) *MockTagRepository {
621	mock := &MockTagRepository{}
622	mock.Mock.Test(t)
623
624	t.Cleanup(func() { mock.AssertExpectations(t) })
625
626	return mock
627}
628
629// MockTagRepository is an autogenerated mock type for the TagRepository type
630type MockTagRepository struct {
631	mock.Mock
632}
633
634type MockTagRepository_Expecter struct {
635	mock *mock.Mock
636}
637
638func (_m *MockTagRepository) EXPECT() *MockTagRepository_Expecter {
639	return &MockTagRepository_Expecter{mock: &_m.Mock}
640}
641
642// AssignToFavorite provides a mock function for the type MockTagRepository
643func (_mock *MockTagRepository) AssignToFavorite(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID) error {
644	ret := _mock.Called(ctx, tagID, favID)
645
646	if len(ret) == 0 {
647		panic("no return value specified for AssignToFavorite")
648	}
649
650	var r0 error
651	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID, entity.FavoriteID) error); ok {
652		r0 = returnFunc(ctx, tagID, favID)
653	} else {
654		r0 = ret.Error(0)
655	}
656	return r0
657}
658
659// MockTagRepository_AssignToFavorite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AssignToFavorite'
660type MockTagRepository_AssignToFavorite_Call struct {
661	*mock.Call
662}
663
664// AssignToFavorite is a helper method to define mock.On call
665//   - ctx context.Context
666//   - tagID entity.TagID
667//   - favID entity.FavoriteID
668func (_e *MockTagRepository_Expecter) AssignToFavorite(ctx any, tagID any, favID any) *MockTagRepository_AssignToFavorite_Call {
669	return &MockTagRepository_AssignToFavorite_Call{Call: _e.mock.On("AssignToFavorite", ctx, tagID, favID)}
670}
671
672func (_c *MockTagRepository_AssignToFavorite_Call) Run(run func(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID)) *MockTagRepository_AssignToFavorite_Call {
673	_c.Call.Run(func(args mock.Arguments) {
674		var arg0 context.Context
675		if args[0] != nil {
676			arg0 = args[0].(context.Context)
677		}
678		var arg1 entity.TagID
679		if args[1] != nil {
680			arg1 = args[1].(entity.TagID)
681		}
682		var arg2 entity.FavoriteID
683		if args[2] != nil {
684			arg2 = args[2].(entity.FavoriteID)
685		}
686		run(
687			arg0,
688			arg1,
689			arg2,
690		)
691	})
692	return _c
693}
694
695func (_c *MockTagRepository_AssignToFavorite_Call) Return(err error) *MockTagRepository_AssignToFavorite_Call {
696	_c.Call.Return(err)
697	return _c
698}
699
700func (_c *MockTagRepository_AssignToFavorite_Call) RunAndReturn(run func(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID) error) *MockTagRepository_AssignToFavorite_Call {
701	_c.Call.Return(run)
702	return _c
703}
704
705// Delete provides a mock function for the type MockTagRepository
706func (_mock *MockTagRepository) Delete(ctx context.Context, id entity.TagID) error {
707	ret := _mock.Called(ctx, id)
708
709	if len(ret) == 0 {
710		panic("no return value specified for Delete")
711	}
712
713	var r0 error
714	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID) error); ok {
715		r0 = returnFunc(ctx, id)
716	} else {
717		r0 = ret.Error(0)
718	}
719	return r0
720}
721
722// MockTagRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
723type MockTagRepository_Delete_Call struct {
724	*mock.Call
725}
726
727// Delete is a helper method to define mock.On call
728//   - ctx context.Context
729//   - id entity.TagID
730func (_e *MockTagRepository_Expecter) Delete(ctx any, id any) *MockTagRepository_Delete_Call {
731	return &MockTagRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)}
732}
733
734func (_c *MockTagRepository_Delete_Call) Run(run func(ctx context.Context, id entity.TagID)) *MockTagRepository_Delete_Call {
735	_c.Call.Run(func(args mock.Arguments) {
736		var arg0 context.Context
737		if args[0] != nil {
738			arg0 = args[0].(context.Context)
739		}
740		var arg1 entity.TagID
741		if args[1] != nil {
742			arg1 = args[1].(entity.TagID)
743		}
744		run(
745			arg0,
746			arg1,
747		)
748	})
749	return _c
750}
751
752func (_c *MockTagRepository_Delete_Call) Return(err error) *MockTagRepository_Delete_Call {
753	_c.Call.Return(err)
754	return _c
755}
756
757func (_c *MockTagRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, id entity.TagID) error) *MockTagRepository_Delete_Call {
758	_c.Call.Return(run)
759	return _c
760}
761
762// FindByID provides a mock function for the type MockTagRepository
763func (_mock *MockTagRepository) FindByID(ctx context.Context, id entity.TagID) (*entity.Tag, error) {
764	ret := _mock.Called(ctx, id)
765
766	if len(ret) == 0 {
767		panic("no return value specified for FindByID")
768	}
769
770	var r0 *entity.Tag
771	var r1 error
772	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID) (*entity.Tag, error)); ok {
773		return returnFunc(ctx, id)
774	}
775	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID) *entity.Tag); ok {
776		r0 = returnFunc(ctx, id)
777	} else {
778		if ret.Get(0) != nil {
779			r0 = ret.Get(0).(*entity.Tag)
780		}
781	}
782	if returnFunc, ok := ret.Get(1).(func(context.Context, entity.TagID) error); ok {
783		r1 = returnFunc(ctx, id)
784	} else {
785		r1 = ret.Error(1)
786	}
787	return r0, r1
788}
789
790// MockTagRepository_FindByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByID'
791type MockTagRepository_FindByID_Call struct {
792	*mock.Call
793}
794
795// FindByID is a helper method to define mock.On call
796//   - ctx context.Context
797//   - id entity.TagID
798func (_e *MockTagRepository_Expecter) FindByID(ctx any, id any) *MockTagRepository_FindByID_Call {
799	return &MockTagRepository_FindByID_Call{Call: _e.mock.On("FindByID", ctx, id)}
800}
801
802func (_c *MockTagRepository_FindByID_Call) Run(run func(ctx context.Context, id entity.TagID)) *MockTagRepository_FindByID_Call {
803	_c.Call.Run(func(args mock.Arguments) {
804		var arg0 context.Context
805		if args[0] != nil {
806			arg0 = args[0].(context.Context)
807		}
808		var arg1 entity.TagID
809		if args[1] != nil {
810			arg1 = args[1].(entity.TagID)
811		}
812		run(
813			arg0,
814			arg1,
815		)
816	})
817	return _c
818}
819
820func (_c *MockTagRepository_FindByID_Call) Return(tag *entity.Tag, err error) *MockTagRepository_FindByID_Call {
821	_c.Call.Return(tag, err)
822	return _c
823}
824
825func (_c *MockTagRepository_FindByID_Call) RunAndReturn(run func(ctx context.Context, id entity.TagID) (*entity.Tag, error)) *MockTagRepository_FindByID_Call {
826	_c.Call.Return(run)
827	return _c
828}
829
830// FindByName provides a mock function for the type MockTagRepository
831func (_mock *MockTagRepository) FindByName(ctx context.Context, name string) (*entity.Tag, error) {
832	ret := _mock.Called(ctx, name)
833
834	if len(ret) == 0 {
835		panic("no return value specified for FindByName")
836	}
837
838	var r0 *entity.Tag
839	var r1 error
840	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*entity.Tag, error)); ok {
841		return returnFunc(ctx, name)
842	}
843	if returnFunc, ok := ret.Get(0).(func(context.Context, string) *entity.Tag); ok {
844		r0 = returnFunc(ctx, name)
845	} else {
846		if ret.Get(0) != nil {
847			r0 = ret.Get(0).(*entity.Tag)
848		}
849	}
850	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
851		r1 = returnFunc(ctx, name)
852	} else {
853		r1 = ret.Error(1)
854	}
855	return r0, r1
856}
857
858// MockTagRepository_FindByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByName'
859type MockTagRepository_FindByName_Call struct {
860	*mock.Call
861}
862
863// FindByName is a helper method to define mock.On call
864//   - ctx context.Context
865//   - name string
866func (_e *MockTagRepository_Expecter) FindByName(ctx any, name any) *MockTagRepository_FindByName_Call {
867	return &MockTagRepository_FindByName_Call{Call: _e.mock.On("FindByName", ctx, name)}
868}
869
870func (_c *MockTagRepository_FindByName_Call) Run(run func(ctx context.Context, name string)) *MockTagRepository_FindByName_Call {
871	_c.Call.Run(func(args mock.Arguments) {
872		var arg0 context.Context
873		if args[0] != nil {
874			arg0 = args[0].(context.Context)
875		}
876		var arg1 string
877		if args[1] != nil {
878			arg1 = args[1].(string)
879		}
880		run(
881			arg0,
882			arg1,
883		)
884	})
885	return _c
886}
887
888func (_c *MockTagRepository_FindByName_Call) Return(tag *entity.Tag, err error) *MockTagRepository_FindByName_Call {
889	_c.Call.Return(tag, err)
890	return _c
891}
892
893func (_c *MockTagRepository_FindByName_Call) RunAndReturn(run func(ctx context.Context, name string) (*entity.Tag, error)) *MockTagRepository_FindByName_Call {
894	_c.Call.Return(run)
895	return _c
896}
897
898// GetAll provides a mock function for the type MockTagRepository
899func (_mock *MockTagRepository) GetAll(ctx context.Context) ([]*entity.Tag, error) {
900	ret := _mock.Called(ctx)
901
902	if len(ret) == 0 {
903		panic("no return value specified for GetAll")
904	}
905
906	var r0 []*entity.Tag
907	var r1 error
908	if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.Tag, error)); ok {
909		return returnFunc(ctx)
910	}
911	if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.Tag); ok {
912		r0 = returnFunc(ctx)
913	} else {
914		if ret.Get(0) != nil {
915			r0 = ret.Get(0).([]*entity.Tag)
916		}
917	}
918	if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
919		r1 = returnFunc(ctx)
920	} else {
921		r1 = ret.Error(1)
922	}
923	return r0, r1
924}
925
926// MockTagRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll'
927type MockTagRepository_GetAll_Call struct {
928	*mock.Call
929}
930
931// GetAll is a helper method to define mock.On call
932//   - ctx context.Context
933func (_e *MockTagRepository_Expecter) GetAll(ctx any) *MockTagRepository_GetAll_Call {
934	return &MockTagRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx)}
935}
936
937func (_c *MockTagRepository_GetAll_Call) Run(run func(ctx context.Context)) *MockTagRepository_GetAll_Call {
938	_c.Call.Run(func(args mock.Arguments) {
939		var arg0 context.Context
940		if args[0] != nil {
941			arg0 = args[0].(context.Context)
942		}
943		run(
944			arg0,
945		)
946	})
947	return _c
948}
949
950func (_c *MockTagRepository_GetAll_Call) Return(tags []*entity.Tag, err error) *MockTagRepository_GetAll_Call {
951	_c.Call.Return(tags, err)
952	return _c
953}
954
955func (_c *MockTagRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.Tag, error)) *MockTagRepository_GetAll_Call {
956	_c.Call.Return(run)
957	return _c
958}
959
960// GetForFavorite provides a mock function for the type MockTagRepository
961func (_mock *MockTagRepository) GetForFavorite(ctx context.Context, favID entity.FavoriteID) ([]*entity.Tag, error) {
962	ret := _mock.Called(ctx, favID)
963
964	if len(ret) == 0 {
965		panic("no return value specified for GetForFavorite")
966	}
967
968	var r0 []*entity.Tag
969	var r1 error
970	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) ([]*entity.Tag, error)); ok {
971		return returnFunc(ctx, favID)
972	}
973	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) []*entity.Tag); ok {
974		r0 = returnFunc(ctx, favID)
975	} else {
976		if ret.Get(0) != nil {
977			r0 = ret.Get(0).([]*entity.Tag)
978		}
979	}
980	if returnFunc, ok := ret.Get(1).(func(context.Context, entity.FavoriteID) error); ok {
981		r1 = returnFunc(ctx, favID)
982	} else {
983		r1 = ret.Error(1)
984	}
985	return r0, r1
986}
987
988// MockTagRepository_GetForFavorite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetForFavorite'
989type MockTagRepository_GetForFavorite_Call struct {
990	*mock.Call
991}
992
993// GetForFavorite is a helper method to define mock.On call
994//   - ctx context.Context
995//   - favID entity.FavoriteID
996func (_e *MockTagRepository_Expecter) GetForFavorite(ctx any, favID any) *MockTagRepository_GetForFavorite_Call {
997	return &MockTagRepository_GetForFavorite_Call{Call: _e.mock.On("GetForFavorite", ctx, favID)}
998}
999
1000func (_c *MockTagRepository_GetForFavorite_Call) Run(run func(ctx context.Context, favID entity.FavoriteID)) *MockTagRepository_GetForFavorite_Call {
1001	_c.Call.Run(func(args mock.Arguments) {
1002		var arg0 context.Context
1003		if args[0] != nil {
1004			arg0 = args[0].(context.Context)
1005		}
1006		var arg1 entity.FavoriteID
1007		if args[1] != nil {
1008			arg1 = args[1].(entity.FavoriteID)
1009		}
1010		run(
1011			arg0,
1012			arg1,
1013		)
1014	})
1015	return _c
1016}
1017
1018func (_c *MockTagRepository_GetForFavorite_Call) Return(tags []*entity.Tag, err error) *MockTagRepository_GetForFavorite_Call {
1019	_c.Call.Return(tags, err)
1020	return _c
1021}
1022
1023func (_c *MockTagRepository_GetForFavorite_Call) RunAndReturn(run func(ctx context.Context, favID entity.FavoriteID) ([]*entity.Tag, error)) *MockTagRepository_GetForFavorite_Call {
1024	_c.Call.Return(run)
1025	return _c
1026}
1027
1028// RemoveFromFavorite provides a mock function for the type MockTagRepository
1029func (_mock *MockTagRepository) RemoveFromFavorite(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID) error {
1030	ret := _mock.Called(ctx, tagID, favID)
1031
1032	if len(ret) == 0 {
1033		panic("no return value specified for RemoveFromFavorite")
1034	}
1035
1036	var r0 error
1037	if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID, entity.FavoriteID) error); ok {
1038		r0 = returnFunc(ctx, tagID, favID)
1039	} else {
1040		r0 = ret.Error(0)
1041	}
1042	return r0
1043}
1044
1045// MockTagRepository_RemoveFromFavorite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveFromFavorite'
1046type MockTagRepository_RemoveFromFavorite_Call struct {
1047	*mock.Call
1048}
1049
1050// RemoveFromFavorite is a helper method to define mock.On call
1051//   - ctx context.Context
1052//   - tagID entity.TagID
1053//   - favID entity.FavoriteID
1054func (_e *MockTagRepository_Expecter) RemoveFromFavorite(ctx any, tagID any, favID any) *MockTagRepository_RemoveFromFavorite_Call {
1055	return &MockTagRepository_RemoveFromFavorite_Call{Call: _e.mock.On("RemoveFromFavorite", ctx, tagID, favID)}
1056}
1057
1058func (_c *MockTagRepository_RemoveFromFavorite_Call) Run(run func(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID)) *MockTagRepository_RemoveFromFavorite_Call {
1059	_c.Call.Run(func(args mock.Arguments) {
1060		var arg0 context.Context
1061		if args[0] != nil {
1062			arg0 = args[0].(context.Context)
1063		}
1064		var arg1 entity.TagID
1065		if args[1] != nil {
1066			arg1 = args[1].(entity.TagID)
1067		}
1068		var arg2 entity.FavoriteID
1069		if args[2] != nil {
1070			arg2 = args[2].(entity.FavoriteID)
1071		}
1072		run(
1073			arg0,
1074			arg1,
1075			arg2,
1076		)
1077	})
1078	return _c
1079}
1080
1081func (_c *MockTagRepository_RemoveFromFavorite_Call) Return(err error) *MockTagRepository_RemoveFromFavorite_Call {
1082	_c.Call.Return(err)
1083	return _c
1084}
1085
1086func (_c *MockTagRepository_RemoveFromFavorite_Call) RunAndReturn(run func(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID) error) *MockTagRepository_RemoveFromFavorite_Call {
1087	_c.Call.Return(run)
1088	return _c
1089}
1090
1091// Save provides a mock function for the type MockTagRepository
1092func (_mock *MockTagRepository) Save(ctx context.Context, tag *entity.Tag) error {
1093	ret := _mock.Called(ctx, tag)
1094
1095	if len(ret) == 0 {
1096		panic("no return value specified for Save")
1097	}
1098
1099	var r0 error
1100	if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.Tag) error); ok {
1101		r0 = returnFunc(ctx, tag)
1102	} else {
1103		r0 = ret.Error(0)
1104	}
1105	return r0
1106}
1107
1108// MockTagRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save'
1109type MockTagRepository_Save_Call struct {
1110	*mock.Call
1111}
1112
1113// Save is a helper method to define mock.On call
1114//   - ctx context.Context
1115//   - tag *entity.Tag
1116func (_e *MockTagRepository_Expecter) Save(ctx any, tag any) *MockTagRepository_Save_Call {
1117	return &MockTagRepository_Save_Call{Call: _e.mock.On("Save", ctx, tag)}
1118}
1119
1120func (_c *MockTagRepository_Save_Call) Run(run func(ctx context.Context, tag *entity.Tag)) *MockTagRepository_Save_Call {
1121	_c.Call.Run(func(args mock.Arguments) {
1122		var arg0 context.Context
1123		if args[0] != nil {
1124			arg0 = args[0].(context.Context)
1125		}
1126		var arg1 *entity.Tag
1127		if args[1] != nil {
1128			arg1 = args[1].(*entity.Tag)
1129		}
1130		run(
1131			arg0,
1132			arg1,
1133		)
1134	})
1135	return _c
1136}
1137
1138func (_c *MockTagRepository_Save_Call) Return(err error) *MockTagRepository_Save_Call {
1139	_c.Call.Return(err)
1140	return _c
1141}
1142
1143func (_c *MockTagRepository_Save_Call) RunAndReturn(run func(ctx context.Context, tag *entity.Tag) error) *MockTagRepository_Save_Call {
1144	_c.Call.Return(run)
1145	return _c
1146}

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 8

Tags 42

↑↓ moveenter openesc close