detached 83e495f

RepoService.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	"bnema.dev/ermite/internal/domain"
11	"bnema.dev/ermite/internal/ports"
12	mock "github.com/stretchr/testify/mock"
13)
14
15// NewRepoService creates a new instance of RepoService. 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 NewRepoService(t interface {
18	mock.TestingT
19	Cleanup(func())
20}) *RepoService {
21	if helper, ok := t.(interface{ Helper() }); ok {
22		helper.Helper()
23	}
24
25	mock := &RepoService{}
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// RepoService is an autogenerated mock type for the RepoService type
39type RepoService struct {
40	mock.Mock
41}
42
43type RepoService_Expecter struct {
44	mock *mock.Mock
45}
46
47func (_m *RepoService) EXPECT() *RepoService_Expecter {
48	return &RepoService_Expecter{mock: &_m.Mock}
49}
50
51// Create provides a mock function for the type RepoService
52func (_mock *RepoService) Create(ctx context.Context, p domain.Principal, params ports.CreateRepoParams) (domain.Repo, error) {
53	ret := _mock.Called(ctx, p, params)
54
55	if len(ret) == 0 {
56		panic("no return value specified for Create")
57	}
58
59	var r0 domain.Repo
60	var r1 error
61	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, ports.CreateRepoParams) (domain.Repo, error)); ok {
62		return returnFunc(ctx, p, params)
63	}
64	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, ports.CreateRepoParams) domain.Repo); ok {
65		r0 = returnFunc(ctx, p, params)
66	} else {
67		r0 = ret.Get(0).(domain.Repo)
68	}
69	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, ports.CreateRepoParams) error); ok {
70		r1 = returnFunc(ctx, p, params)
71	} else {
72		r1 = ret.Error(1)
73	}
74	return r0, r1
75}
76
77// RepoService_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
78type RepoService_Create_Call struct {
79	*mock.Call
80}
81
82// Create is a helper method to define mock.On call
83//   - ctx context.Context
84//   - p domain.Principal
85//   - params ports.CreateRepoParams
86func (_e *RepoService_Expecter) Create(ctx any, p any, params any) *RepoService_Create_Call {
87	return &RepoService_Create_Call{Call: _e.mock.On("Create", ctx, p, params)}
88}
89
90func (_c *RepoService_Create_Call) Run(run func(ctx context.Context, p domain.Principal, params ports.CreateRepoParams)) *RepoService_Create_Call {
91	_c.Call.Run(func(args mock.Arguments) {
92		var arg0 context.Context
93		if args[0] != nil {
94			arg0 = args[0].(context.Context)
95		}
96		var arg1 domain.Principal
97		if args[1] != nil {
98			arg1 = args[1].(domain.Principal)
99		}
100		var arg2 ports.CreateRepoParams
101		if args[2] != nil {
102			arg2 = args[2].(ports.CreateRepoParams)
103		}
104		run(
105			arg0,
106			arg1,
107			arg2,
108		)
109	})
110	return _c
111}
112
113func (_c *RepoService_Create_Call) Return(repo domain.Repo, err error) *RepoService_Create_Call {
114	_c.Call.Return(repo, err)
115	return _c
116}
117
118func (_c *RepoService_Create_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, params ports.CreateRepoParams) (domain.Repo, error)) *RepoService_Create_Call {
119	_c.Call.Return(run)
120	return _c
121}
122
123// Delete provides a mock function for the type RepoService
124func (_mock *RepoService) Delete(ctx context.Context, p domain.Principal, name domain.RepoName) error {
125	ret := _mock.Called(ctx, p, name)
126
127	if len(ret) == 0 {
128		panic("no return value specified for Delete")
129	}
130
131	var r0 error
132	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName) error); ok {
133		r0 = returnFunc(ctx, p, name)
134	} else {
135		r0 = ret.Error(0)
136	}
137	return r0
138}
139
140// RepoService_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
141type RepoService_Delete_Call struct {
142	*mock.Call
143}
144
145// Delete is a helper method to define mock.On call
146//   - ctx context.Context
147//   - p domain.Principal
148//   - name domain.RepoName
149func (_e *RepoService_Expecter) Delete(ctx any, p any, name any) *RepoService_Delete_Call {
150	return &RepoService_Delete_Call{Call: _e.mock.On("Delete", ctx, p, name)}
151}
152
153func (_c *RepoService_Delete_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName)) *RepoService_Delete_Call {
154	_c.Call.Run(func(args mock.Arguments) {
155		var arg0 context.Context
156		if args[0] != nil {
157			arg0 = args[0].(context.Context)
158		}
159		var arg1 domain.Principal
160		if args[1] != nil {
161			arg1 = args[1].(domain.Principal)
162		}
163		var arg2 domain.RepoName
164		if args[2] != nil {
165			arg2 = args[2].(domain.RepoName)
166		}
167		run(
168			arg0,
169			arg1,
170			arg2,
171		)
172	})
173	return _c
174}
175
176func (_c *RepoService_Delete_Call) Return(err error) *RepoService_Delete_Call {
177	_c.Call.Return(err)
178	return _c
179}
180
181func (_c *RepoService_Delete_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName) error) *RepoService_Delete_Call {
182	_c.Call.Return(run)
183	return _c
184}
185
186// Get provides a mock function for the type RepoService
187func (_mock *RepoService) Get(ctx context.Context, p domain.Principal, name domain.RepoName) (domain.Repo, error) {
188	ret := _mock.Called(ctx, p, name)
189
190	if len(ret) == 0 {
191		panic("no return value specified for Get")
192	}
193
194	var r0 domain.Repo
195	var r1 error
196	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName) (domain.Repo, error)); ok {
197		return returnFunc(ctx, p, name)
198	}
199	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName) domain.Repo); ok {
200		r0 = returnFunc(ctx, p, name)
201	} else {
202		r0 = ret.Get(0).(domain.Repo)
203	}
204	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName) error); ok {
205		r1 = returnFunc(ctx, p, name)
206	} else {
207		r1 = ret.Error(1)
208	}
209	return r0, r1
210}
211
212// RepoService_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
213type RepoService_Get_Call struct {
214	*mock.Call
215}
216
217// Get is a helper method to define mock.On call
218//   - ctx context.Context
219//   - p domain.Principal
220//   - name domain.RepoName
221func (_e *RepoService_Expecter) Get(ctx any, p any, name any) *RepoService_Get_Call {
222	return &RepoService_Get_Call{Call: _e.mock.On("Get", ctx, p, name)}
223}
224
225func (_c *RepoService_Get_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName)) *RepoService_Get_Call {
226	_c.Call.Run(func(args mock.Arguments) {
227		var arg0 context.Context
228		if args[0] != nil {
229			arg0 = args[0].(context.Context)
230		}
231		var arg1 domain.Principal
232		if args[1] != nil {
233			arg1 = args[1].(domain.Principal)
234		}
235		var arg2 domain.RepoName
236		if args[2] != nil {
237			arg2 = args[2].(domain.RepoName)
238		}
239		run(
240			arg0,
241			arg1,
242			arg2,
243		)
244	})
245	return _c
246}
247
248func (_c *RepoService_Get_Call) Return(repo domain.Repo, err error) *RepoService_Get_Call {
249	_c.Call.Return(repo, err)
250	return _c
251}
252
253func (_c *RepoService_Get_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName) (domain.Repo, error)) *RepoService_Get_Call {
254	_c.Call.Return(run)
255	return _c
256}
257
258// ListPage provides a mock function for the type RepoService
259func (_mock *RepoService) ListPage(ctx context.Context, p domain.Principal, size int, token string) (ports.RepoPage, error) {
260	ret := _mock.Called(ctx, p, size, token)
261
262	if len(ret) == 0 {
263		panic("no return value specified for ListPage")
264	}
265
266	var r0 ports.RepoPage
267	var r1 error
268	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, int, string) (ports.RepoPage, error)); ok {
269		return returnFunc(ctx, p, size, token)
270	}
271	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, int, string) ports.RepoPage); ok {
272		r0 = returnFunc(ctx, p, size, token)
273	} else {
274		r0 = ret.Get(0).(ports.RepoPage)
275	}
276	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, int, string) error); ok {
277		r1 = returnFunc(ctx, p, size, token)
278	} else {
279		r1 = ret.Error(1)
280	}
281	return r0, r1
282}
283
284// RepoService_ListPage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPage'
285type RepoService_ListPage_Call struct {
286	*mock.Call
287}
288
289// ListPage is a helper method to define mock.On call
290//   - ctx context.Context
291//   - p domain.Principal
292//   - size int
293//   - token string
294func (_e *RepoService_Expecter) ListPage(ctx any, p any, size any, token any) *RepoService_ListPage_Call {
295	return &RepoService_ListPage_Call{Call: _e.mock.On("ListPage", ctx, p, size, token)}
296}
297
298func (_c *RepoService_ListPage_Call) Run(run func(ctx context.Context, p domain.Principal, size int, token string)) *RepoService_ListPage_Call {
299	_c.Call.Run(func(args mock.Arguments) {
300		var arg0 context.Context
301		if args[0] != nil {
302			arg0 = args[0].(context.Context)
303		}
304		var arg1 domain.Principal
305		if args[1] != nil {
306			arg1 = args[1].(domain.Principal)
307		}
308		var arg2 int
309		if args[2] != nil {
310			arg2 = args[2].(int)
311		}
312		var arg3 string
313		if args[3] != nil {
314			arg3 = args[3].(string)
315		}
316		run(
317			arg0,
318			arg1,
319			arg2,
320			arg3,
321		)
322	})
323	return _c
324}
325
326func (_c *RepoService_ListPage_Call) Return(repoPage ports.RepoPage, err error) *RepoService_ListPage_Call {
327	_c.Call.Return(repoPage, err)
328	return _c
329}
330
331func (_c *RepoService_ListPage_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, size int, token string) (ports.RepoPage, error)) *RepoService_ListPage_Call {
332	_c.Call.Return(run)
333	return _c
334}
335
336// Update provides a mock function for the type RepoService
337func (_mock *RepoService) Update(ctx context.Context, p domain.Principal, name domain.RepoName, params ports.UpdateRepoParams) (domain.Repo, error) {
338	ret := _mock.Called(ctx, p, name, params)
339
340	if len(ret) == 0 {
341		panic("no return value specified for Update")
342	}
343
344	var r0 domain.Repo
345	var r1 error
346	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.UpdateRepoParams) (domain.Repo, error)); ok {
347		return returnFunc(ctx, p, name, params)
348	}
349	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.UpdateRepoParams) domain.Repo); ok {
350		r0 = returnFunc(ctx, p, name, params)
351	} else {
352		r0 = ret.Get(0).(domain.Repo)
353	}
354	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, ports.UpdateRepoParams) error); ok {
355		r1 = returnFunc(ctx, p, name, params)
356	} else {
357		r1 = ret.Error(1)
358	}
359	return r0, r1
360}
361
362// RepoService_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
363type RepoService_Update_Call struct {
364	*mock.Call
365}
366
367// Update is a helper method to define mock.On call
368//   - ctx context.Context
369//   - p domain.Principal
370//   - name domain.RepoName
371//   - params ports.UpdateRepoParams
372func (_e *RepoService_Expecter) Update(ctx any, p any, name any, params any) *RepoService_Update_Call {
373	return &RepoService_Update_Call{Call: _e.mock.On("Update", ctx, p, name, params)}
374}
375
376func (_c *RepoService_Update_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName, params ports.UpdateRepoParams)) *RepoService_Update_Call {
377	_c.Call.Run(func(args mock.Arguments) {
378		var arg0 context.Context
379		if args[0] != nil {
380			arg0 = args[0].(context.Context)
381		}
382		var arg1 domain.Principal
383		if args[1] != nil {
384			arg1 = args[1].(domain.Principal)
385		}
386		var arg2 domain.RepoName
387		if args[2] != nil {
388			arg2 = args[2].(domain.RepoName)
389		}
390		var arg3 ports.UpdateRepoParams
391		if args[3] != nil {
392			arg3 = args[3].(ports.UpdateRepoParams)
393		}
394		run(
395			arg0,
396			arg1,
397			arg2,
398			arg3,
399		)
400	})
401	return _c
402}
403
404func (_c *RepoService_Update_Call) Return(repo domain.Repo, err error) *RepoService_Update_Call {
405	_c.Call.Return(repo, err)
406	return _c
407}
408
409func (_c *RepoService_Update_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName, params ports.UpdateRepoParams) (domain.Repo, error)) *RepoService_Update_Call {
410	_c.Call.Return(run)
411	return _c
412}
413
414// View provides a mock function for the type RepoService
415func (_mock *RepoService) View(ctx context.Context, repo domain.Repo) (ports.RepoView, error) {
416	ret := _mock.Called(ctx, repo)
417
418	if len(ret) == 0 {
419		panic("no return value specified for View")
420	}
421
422	var r0 ports.RepoView
423	var r1 error
424	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Repo) (ports.RepoView, error)); ok {
425		return returnFunc(ctx, repo)
426	}
427	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Repo) ports.RepoView); ok {
428		r0 = returnFunc(ctx, repo)
429	} else {
430		r0 = ret.Get(0).(ports.RepoView)
431	}
432	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Repo) error); ok {
433		r1 = returnFunc(ctx, repo)
434	} else {
435		r1 = ret.Error(1)
436	}
437	return r0, r1
438}
439
440// RepoService_View_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'View'
441type RepoService_View_Call struct {
442	*mock.Call
443}
444
445// View is a helper method to define mock.On call
446//   - ctx context.Context
447//   - repo domain.Repo
448func (_e *RepoService_Expecter) View(ctx any, repo any) *RepoService_View_Call {
449	return &RepoService_View_Call{Call: _e.mock.On("View", ctx, repo)}
450}
451
452func (_c *RepoService_View_Call) Run(run func(ctx context.Context, repo domain.Repo)) *RepoService_View_Call {
453	_c.Call.Run(func(args mock.Arguments) {
454		var arg0 context.Context
455		if args[0] != nil {
456			arg0 = args[0].(context.Context)
457		}
458		var arg1 domain.Repo
459		if args[1] != nil {
460			arg1 = args[1].(domain.Repo)
461		}
462		run(
463			arg0,
464			arg1,
465		)
466	})
467	return _c
468}
469
470func (_c *RepoService_View_Call) Return(repoView ports.RepoView, err error) *RepoService_View_Call {
471	_c.Call.Return(repoView, err)
472	return _c
473}
474
475func (_c *RepoService_View_Call) RunAndReturn(run func(ctx context.Context, repo domain.Repo) (ports.RepoView, error)) *RepoService_View_Call {
476	_c.Call.Return(run)
477	return _c
478}

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 4

Tags 45

↑↓ moveenter openesc close