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

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