v0.30.0 eb3068f

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

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