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

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