detached 83e495f

TrustedKeyService.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	mock "github.com/stretchr/testify/mock"
12)
13
14// NewTrustedKeyService creates a new instance of TrustedKeyService. 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 NewTrustedKeyService(t interface {
17	mock.TestingT
18	Cleanup(func())
19}) *TrustedKeyService {
20	if helper, ok := t.(interface{ Helper() }); ok {
21		helper.Helper()
22	}
23
24	mock := &TrustedKeyService{}
25	mock.Mock.Test(t)
26
27	t.Cleanup(func() {
28		if helper, ok := t.(interface{ Helper() }); ok {
29			helper.Helper()
30		}
31		mock.AssertExpectations(t)
32	})
33
34	return mock
35}
36
37// TrustedKeyService is an autogenerated mock type for the TrustedKeyService type
38type TrustedKeyService struct {
39	mock.Mock
40}
41
42type TrustedKeyService_Expecter struct {
43	mock *mock.Mock
44}
45
46func (_m *TrustedKeyService) EXPECT() *TrustedKeyService_Expecter {
47	return &TrustedKeyService_Expecter{mock: &_m.Mock}
48}
49
50// AddTrustedKey provides a mock function for the type TrustedKeyService
51func (_mock *TrustedKeyService) AddTrustedKey(ctx context.Context, p domain.Principal, format domain.SignatureFormat, title string, publicKey string, emails []string) (domain.TrustedKey, error) {
52	ret := _mock.Called(ctx, p, format, title, publicKey, emails)
53
54	if len(ret) == 0 {
55		panic("no return value specified for AddTrustedKey")
56	}
57
58	var r0 domain.TrustedKey
59	var r1 error
60	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SignatureFormat, string, string, []string) (domain.TrustedKey, error)); ok {
61		return returnFunc(ctx, p, format, title, publicKey, emails)
62	}
63	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SignatureFormat, string, string, []string) domain.TrustedKey); ok {
64		r0 = returnFunc(ctx, p, format, title, publicKey, emails)
65	} else {
66		r0 = ret.Get(0).(domain.TrustedKey)
67	}
68	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.SignatureFormat, string, string, []string) error); ok {
69		r1 = returnFunc(ctx, p, format, title, publicKey, emails)
70	} else {
71		r1 = ret.Error(1)
72	}
73	return r0, r1
74}
75
76// TrustedKeyService_AddTrustedKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddTrustedKey'
77type TrustedKeyService_AddTrustedKey_Call struct {
78	*mock.Call
79}
80
81// AddTrustedKey is a helper method to define mock.On call
82//   - ctx context.Context
83//   - p domain.Principal
84//   - format domain.SignatureFormat
85//   - title string
86//   - publicKey string
87//   - emails []string
88func (_e *TrustedKeyService_Expecter) AddTrustedKey(ctx any, p any, format any, title any, publicKey any, emails any) *TrustedKeyService_AddTrustedKey_Call {
89	return &TrustedKeyService_AddTrustedKey_Call{Call: _e.mock.On("AddTrustedKey", ctx, p, format, title, publicKey, emails)}
90}
91
92func (_c *TrustedKeyService_AddTrustedKey_Call) Run(run func(ctx context.Context, p domain.Principal, format domain.SignatureFormat, title string, publicKey string, emails []string)) *TrustedKeyService_AddTrustedKey_Call {
93	_c.Call.Run(func(args mock.Arguments) {
94		var arg0 context.Context
95		if args[0] != nil {
96			arg0 = args[0].(context.Context)
97		}
98		var arg1 domain.Principal
99		if args[1] != nil {
100			arg1 = args[1].(domain.Principal)
101		}
102		var arg2 domain.SignatureFormat
103		if args[2] != nil {
104			arg2 = args[2].(domain.SignatureFormat)
105		}
106		var arg3 string
107		if args[3] != nil {
108			arg3 = args[3].(string)
109		}
110		var arg4 string
111		if args[4] != nil {
112			arg4 = args[4].(string)
113		}
114		var arg5 []string
115		if args[5] != nil {
116			arg5 = args[5].([]string)
117		}
118		run(
119			arg0,
120			arg1,
121			arg2,
122			arg3,
123			arg4,
124			arg5,
125		)
126	})
127	return _c
128}
129
130func (_c *TrustedKeyService_AddTrustedKey_Call) Return(trustedKey domain.TrustedKey, err error) *TrustedKeyService_AddTrustedKey_Call {
131	_c.Call.Return(trustedKey, err)
132	return _c
133}
134
135func (_c *TrustedKeyService_AddTrustedKey_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, format domain.SignatureFormat, title string, publicKey string, emails []string) (domain.TrustedKey, error)) *TrustedKeyService_AddTrustedKey_Call {
136	_c.Call.Return(run)
137	return _c
138}
139
140// ListTrustedKeys provides a mock function for the type TrustedKeyService
141func (_mock *TrustedKeyService) ListTrustedKeys(ctx context.Context, p domain.Principal) ([]domain.TrustedKey, error) {
142	ret := _mock.Called(ctx, p)
143
144	if len(ret) == 0 {
145		panic("no return value specified for ListTrustedKeys")
146	}
147
148	var r0 []domain.TrustedKey
149	var r1 error
150	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) ([]domain.TrustedKey, error)); ok {
151		return returnFunc(ctx, p)
152	}
153	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) []domain.TrustedKey); ok {
154		r0 = returnFunc(ctx, p)
155	} else {
156		if ret.Get(0) != nil {
157			r0 = ret.Get(0).([]domain.TrustedKey)
158		}
159	}
160	if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal) error); ok {
161		r1 = returnFunc(ctx, p)
162	} else {
163		r1 = ret.Error(1)
164	}
165	return r0, r1
166}
167
168// TrustedKeyService_ListTrustedKeys_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTrustedKeys'
169type TrustedKeyService_ListTrustedKeys_Call struct {
170	*mock.Call
171}
172
173// ListTrustedKeys is a helper method to define mock.On call
174//   - ctx context.Context
175//   - p domain.Principal
176func (_e *TrustedKeyService_Expecter) ListTrustedKeys(ctx any, p any) *TrustedKeyService_ListTrustedKeys_Call {
177	return &TrustedKeyService_ListTrustedKeys_Call{Call: _e.mock.On("ListTrustedKeys", ctx, p)}
178}
179
180func (_c *TrustedKeyService_ListTrustedKeys_Call) Run(run func(ctx context.Context, p domain.Principal)) *TrustedKeyService_ListTrustedKeys_Call {
181	_c.Call.Run(func(args mock.Arguments) {
182		var arg0 context.Context
183		if args[0] != nil {
184			arg0 = args[0].(context.Context)
185		}
186		var arg1 domain.Principal
187		if args[1] != nil {
188			arg1 = args[1].(domain.Principal)
189		}
190		run(
191			arg0,
192			arg1,
193		)
194	})
195	return _c
196}
197
198func (_c *TrustedKeyService_ListTrustedKeys_Call) Return(trustedKeys []domain.TrustedKey, err error) *TrustedKeyService_ListTrustedKeys_Call {
199	_c.Call.Return(trustedKeys, err)
200	return _c
201}
202
203func (_c *TrustedKeyService_ListTrustedKeys_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal) ([]domain.TrustedKey, error)) *TrustedKeyService_ListTrustedKeys_Call {
204	_c.Call.Return(run)
205	return _c
206}
207
208// RemoveTrustedKey provides a mock function for the type TrustedKeyService
209func (_mock *TrustedKeyService) RemoveTrustedKey(ctx context.Context, p domain.Principal, id string) error {
210	ret := _mock.Called(ctx, p, id)
211
212	if len(ret) == 0 {
213		panic("no return value specified for RemoveTrustedKey")
214	}
215
216	var r0 error
217	if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string) error); ok {
218		r0 = returnFunc(ctx, p, id)
219	} else {
220		r0 = ret.Error(0)
221	}
222	return r0
223}
224
225// TrustedKeyService_RemoveTrustedKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveTrustedKey'
226type TrustedKeyService_RemoveTrustedKey_Call struct {
227	*mock.Call
228}
229
230// RemoveTrustedKey is a helper method to define mock.On call
231//   - ctx context.Context
232//   - p domain.Principal
233//   - id string
234func (_e *TrustedKeyService_Expecter) RemoveTrustedKey(ctx any, p any, id any) *TrustedKeyService_RemoveTrustedKey_Call {
235	return &TrustedKeyService_RemoveTrustedKey_Call{Call: _e.mock.On("RemoveTrustedKey", ctx, p, id)}
236}
237
238func (_c *TrustedKeyService_RemoveTrustedKey_Call) Run(run func(ctx context.Context, p domain.Principal, id string)) *TrustedKeyService_RemoveTrustedKey_Call {
239	_c.Call.Run(func(args mock.Arguments) {
240		var arg0 context.Context
241		if args[0] != nil {
242			arg0 = args[0].(context.Context)
243		}
244		var arg1 domain.Principal
245		if args[1] != nil {
246			arg1 = args[1].(domain.Principal)
247		}
248		var arg2 string
249		if args[2] != nil {
250			arg2 = args[2].(string)
251		}
252		run(
253			arg0,
254			arg1,
255			arg2,
256		)
257	})
258	return _c
259}
260
261func (_c *TrustedKeyService_RemoveTrustedKey_Call) Return(err error) *TrustedKeyService_RemoveTrustedKey_Call {
262	_c.Call.Return(err)
263	return _c
264}
265
266func (_c *TrustedKeyService_RemoveTrustedKey_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, id string) error) *TrustedKeyService_RemoveTrustedKey_Call {
267	_c.Call.Return(run)
268	return _c
269}

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