v3.0.0-alpha.1 6fdddb8

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

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