detached fda3c2b

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

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