mock_backup_service.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	"time"
10
11	"github.com/bnema/gordon/internal/domain"
12	mock "github.com/stretchr/testify/mock"
13)
14
15// NewMockBackupService creates a new instance of MockBackupService. 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 NewMockBackupService(t interface {
18	mock.TestingT
19	Cleanup(func())
20}) *MockBackupService {
21	if helper, ok := t.(interface{ Helper() }); ok {
22		helper.Helper()
23	}
24
25	mock := &MockBackupService{}
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// MockBackupService is an autogenerated mock type for the BackupService type
39type MockBackupService struct {
40	mock.Mock
41}
42
43type MockBackupService_Expecter struct {
44	mock *mock.Mock
45}
46
47func (_m *MockBackupService) EXPECT() *MockBackupService_Expecter {
48	return &MockBackupService_Expecter{mock: &_m.Mock}
49}
50
51// ListBackups provides a mock function for the type MockBackupService
52func (_mock *MockBackupService) ListBackups(ctx context.Context, app string) ([]domain.BackupJob, error) {
53	ret := _mock.Called(ctx, app)
54
55	if len(ret) == 0 {
56		panic("no return value specified for ListBackups")
57	}
58
59	var r0 []domain.BackupJob
60	var r1 error
61	if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]domain.BackupJob, error)); ok {
62		return returnFunc(ctx, app)
63	}
64	if returnFunc, ok := ret.Get(0).(func(context.Context, string) []domain.BackupJob); ok {
65		r0 = returnFunc(ctx, app)
66	} else {
67		if ret.Get(0) != nil {
68			r0 = ret.Get(0).([]domain.BackupJob)
69		}
70	}
71	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
72		r1 = returnFunc(ctx, app)
73	} else {
74		r1 = ret.Error(1)
75	}
76	return r0, r1
77}
78
79// MockBackupService_ListBackups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListBackups'
80type MockBackupService_ListBackups_Call struct {
81	*mock.Call
82}
83
84// ListBackups is a helper method to define mock.On call
85//   - ctx context.Context
86//   - app string
87func (_e *MockBackupService_Expecter) ListBackups(ctx any, app any) *MockBackupService_ListBackups_Call {
88	return &MockBackupService_ListBackups_Call{Call: _e.mock.On("ListBackups", ctx, app)}
89}
90
91func (_c *MockBackupService_ListBackups_Call) Run(run func(ctx context.Context, app string)) *MockBackupService_ListBackups_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 string
98		if args[1] != nil {
99			arg1 = args[1].(string)
100		}
101		run(
102			arg0,
103			arg1,
104		)
105	})
106	return _c
107}
108
109func (_c *MockBackupService_ListBackups_Call) Return(backupJobs []domain.BackupJob, err error) *MockBackupService_ListBackups_Call {
110	_c.Call.Return(backupJobs, err)
111	return _c
112}
113
114func (_c *MockBackupService_ListBackups_Call) RunAndReturn(run func(ctx context.Context, app string) ([]domain.BackupJob, error)) *MockBackupService_ListBackups_Call {
115	_c.Call.Return(run)
116	return _c
117}
118
119// Restore provides a mock function for the type MockBackupService
120func (_mock *MockBackupService) Restore(ctx context.Context, app string, backupID string) error {
121	ret := _mock.Called(ctx, app, backupID)
122
123	if len(ret) == 0 {
124		panic("no return value specified for Restore")
125	}
126
127	var r0 error
128	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
129		r0 = returnFunc(ctx, app, backupID)
130	} else {
131		r0 = ret.Error(0)
132	}
133	return r0
134}
135
136// MockBackupService_Restore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Restore'
137type MockBackupService_Restore_Call struct {
138	*mock.Call
139}
140
141// Restore is a helper method to define mock.On call
142//   - ctx context.Context
143//   - app string
144//   - backupID string
145func (_e *MockBackupService_Expecter) Restore(ctx any, app any, backupID any) *MockBackupService_Restore_Call {
146	return &MockBackupService_Restore_Call{Call: _e.mock.On("Restore", ctx, app, backupID)}
147}
148
149func (_c *MockBackupService_Restore_Call) Run(run func(ctx context.Context, app string, backupID string)) *MockBackupService_Restore_Call {
150	_c.Call.Run(func(args mock.Arguments) {
151		var arg0 context.Context
152		if args[0] != nil {
153			arg0 = args[0].(context.Context)
154		}
155		var arg1 string
156		if args[1] != nil {
157			arg1 = args[1].(string)
158		}
159		var arg2 string
160		if args[2] != nil {
161			arg2 = args[2].(string)
162		}
163		run(
164			arg0,
165			arg1,
166			arg2,
167		)
168	})
169	return _c
170}
171
172func (_c *MockBackupService_Restore_Call) Return(err error) *MockBackupService_Restore_Call {
173	_c.Call.Return(err)
174	return _c
175}
176
177func (_c *MockBackupService_Restore_Call) RunAndReturn(run func(ctx context.Context, app string, backupID string) error) *MockBackupService_Restore_Call {
178	_c.Call.Return(run)
179	return _c
180}
181
182// RestorePITR provides a mock function for the type MockBackupService
183func (_mock *MockBackupService) RestorePITR(ctx context.Context, app string, targetTime time.Time) error {
184	ret := _mock.Called(ctx, app, targetTime)
185
186	if len(ret) == 0 {
187		panic("no return value specified for RestorePITR")
188	}
189
190	var r0 error
191	if returnFunc, ok := ret.Get(0).(func(context.Context, string, time.Time) error); ok {
192		r0 = returnFunc(ctx, app, targetTime)
193	} else {
194		r0 = ret.Error(0)
195	}
196	return r0
197}
198
199// MockBackupService_RestorePITR_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestorePITR'
200type MockBackupService_RestorePITR_Call struct {
201	*mock.Call
202}
203
204// RestorePITR is a helper method to define mock.On call
205//   - ctx context.Context
206//   - app string
207//   - targetTime time.Time
208func (_e *MockBackupService_Expecter) RestorePITR(ctx any, app any, targetTime any) *MockBackupService_RestorePITR_Call {
209	return &MockBackupService_RestorePITR_Call{Call: _e.mock.On("RestorePITR", ctx, app, targetTime)}
210}
211
212func (_c *MockBackupService_RestorePITR_Call) Run(run func(ctx context.Context, app string, targetTime time.Time)) *MockBackupService_RestorePITR_Call {
213	_c.Call.Run(func(args mock.Arguments) {
214		var arg0 context.Context
215		if args[0] != nil {
216			arg0 = args[0].(context.Context)
217		}
218		var arg1 string
219		if args[1] != nil {
220			arg1 = args[1].(string)
221		}
222		var arg2 time.Time
223		if args[2] != nil {
224			arg2 = args[2].(time.Time)
225		}
226		run(
227			arg0,
228			arg1,
229			arg2,
230		)
231	})
232	return _c
233}
234
235func (_c *MockBackupService_RestorePITR_Call) Return(err error) *MockBackupService_RestorePITR_Call {
236	_c.Call.Return(err)
237	return _c
238}
239
240func (_c *MockBackupService_RestorePITR_Call) RunAndReturn(run func(ctx context.Context, app string, targetTime time.Time) error) *MockBackupService_RestorePITR_Call {
241	_c.Call.Return(run)
242	return _c
243}
244
245// RunBackup provides a mock function for the type MockBackupService
246func (_mock *MockBackupService) RunBackup(ctx context.Context, app string, service string, database string) (*domain.BackupResult, error) {
247	ret := _mock.Called(ctx, app, service, database)
248
249	if len(ret) == 0 {
250		panic("no return value specified for RunBackup")
251	}
252
253	var r0 *domain.BackupResult
254	var r1 error
255	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string) (*domain.BackupResult, error)); ok {
256		return returnFunc(ctx, app, service, database)
257	}
258	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string) *domain.BackupResult); ok {
259		r0 = returnFunc(ctx, app, service, database)
260	} else {
261		if ret.Get(0) != nil {
262			r0 = ret.Get(0).(*domain.BackupResult)
263		}
264	}
265	if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok {
266		r1 = returnFunc(ctx, app, service, database)
267	} else {
268		r1 = ret.Error(1)
269	}
270	return r0, r1
271}
272
273// MockBackupService_RunBackup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunBackup'
274type MockBackupService_RunBackup_Call struct {
275	*mock.Call
276}
277
278// RunBackup is a helper method to define mock.On call
279//   - ctx context.Context
280//   - app string
281//   - service string
282//   - database string
283func (_e *MockBackupService_Expecter) RunBackup(ctx any, app any, service any, database any) *MockBackupService_RunBackup_Call {
284	return &MockBackupService_RunBackup_Call{Call: _e.mock.On("RunBackup", ctx, app, service, database)}
285}
286
287func (_c *MockBackupService_RunBackup_Call) Run(run func(ctx context.Context, app string, service string, database string)) *MockBackupService_RunBackup_Call {
288	_c.Call.Run(func(args mock.Arguments) {
289		var arg0 context.Context
290		if args[0] != nil {
291			arg0 = args[0].(context.Context)
292		}
293		var arg1 string
294		if args[1] != nil {
295			arg1 = args[1].(string)
296		}
297		var arg2 string
298		if args[2] != nil {
299			arg2 = args[2].(string)
300		}
301		var arg3 string
302		if args[3] != nil {
303			arg3 = args[3].(string)
304		}
305		run(
306			arg0,
307			arg1,
308			arg2,
309			arg3,
310		)
311	})
312	return _c
313}
314
315func (_c *MockBackupService_RunBackup_Call) Return(backupResult *domain.BackupResult, err error) *MockBackupService_RunBackup_Call {
316	_c.Call.Return(backupResult, err)
317	return _c
318}
319
320func (_c *MockBackupService_RunBackup_Call) RunAndReturn(run func(ctx context.Context, app string, service string, database string) (*domain.BackupResult, error)) *MockBackupService_RunBackup_Call {
321	_c.Call.Return(run)
322	return _c
323}
324
325// Status provides a mock function for the type MockBackupService
326func (_mock *MockBackupService) Status(ctx context.Context) ([]domain.BackupJob, error) {
327	ret := _mock.Called(ctx)
328
329	if len(ret) == 0 {
330		panic("no return value specified for Status")
331	}
332
333	var r0 []domain.BackupJob
334	var r1 error
335	if returnFunc, ok := ret.Get(0).(func(context.Context) ([]domain.BackupJob, error)); ok {
336		return returnFunc(ctx)
337	}
338	if returnFunc, ok := ret.Get(0).(func(context.Context) []domain.BackupJob); ok {
339		r0 = returnFunc(ctx)
340	} else {
341		if ret.Get(0) != nil {
342			r0 = ret.Get(0).([]domain.BackupJob)
343		}
344	}
345	if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
346		r1 = returnFunc(ctx)
347	} else {
348		r1 = ret.Error(1)
349	}
350	return r0, r1
351}
352
353// MockBackupService_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status'
354type MockBackupService_Status_Call struct {
355	*mock.Call
356}
357
358// Status is a helper method to define mock.On call
359//   - ctx context.Context
360func (_e *MockBackupService_Expecter) Status(ctx any) *MockBackupService_Status_Call {
361	return &MockBackupService_Status_Call{Call: _e.mock.On("Status", ctx)}
362}
363
364func (_c *MockBackupService_Status_Call) Run(run func(ctx context.Context)) *MockBackupService_Status_Call {
365	_c.Call.Run(func(args mock.Arguments) {
366		var arg0 context.Context
367		if args[0] != nil {
368			arg0 = args[0].(context.Context)
369		}
370		run(
371			arg0,
372		)
373	})
374	return _c
375}
376
377func (_c *MockBackupService_Status_Call) Return(backupJobs []domain.BackupJob, err error) *MockBackupService_Status_Call {
378	_c.Call.Return(backupJobs, err)
379	return _c
380}
381
382func (_c *MockBackupService_Status_Call) RunAndReturn(run func(ctx context.Context) ([]domain.BackupJob, error)) *MockBackupService_Status_Call {
383	_c.Call.Return(run)
384	return _c
385}

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 7

Tags 106

↑↓ moveenter openesc close