v2.31.0-dev6 8056b57

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// DetectDatabases provides a mock function for the type MockBackupService
43func (_mock *MockBackupService) DetectDatabases(ctx context.Context, domainName string) ([]domain.DBInfo, error) {
44	ret := _mock.Called(ctx, domainName)
45
46	if len(ret) == 0 {
47		panic("no return value specified for DetectDatabases")
48	}
49
50	var r0 []domain.DBInfo
51	var r1 error
52	if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]domain.DBInfo, error)); ok {
53		return returnFunc(ctx, domainName)
54	}
55	if returnFunc, ok := ret.Get(0).(func(context.Context, string) []domain.DBInfo); ok {
56		r0 = returnFunc(ctx, domainName)
57	} else {
58		if ret.Get(0) != nil {
59			r0 = ret.Get(0).([]domain.DBInfo)
60		}
61	}
62	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
63		r1 = returnFunc(ctx, domainName)
64	} else {
65		r1 = ret.Error(1)
66	}
67	return r0, r1
68}
69
70// MockBackupService_DetectDatabases_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DetectDatabases'
71type MockBackupService_DetectDatabases_Call struct {
72	*mock.Call
73}
74
75// DetectDatabases is a helper method to define mock.On call
76//   - ctx context.Context
77//   - domainName string
78func (_e *MockBackupService_Expecter) DetectDatabases(ctx interface{}, domainName interface{}) *MockBackupService_DetectDatabases_Call {
79	return &MockBackupService_DetectDatabases_Call{Call: _e.mock.On("DetectDatabases", ctx, domainName)}
80}
81
82func (_c *MockBackupService_DetectDatabases_Call) Run(run func(ctx context.Context, domainName string)) *MockBackupService_DetectDatabases_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_DetectDatabases_Call) Return(dBInfos []domain.DBInfo, err error) *MockBackupService_DetectDatabases_Call {
101	_c.Call.Return(dBInfos, err)
102	return _c
103}
104
105func (_c *MockBackupService_DetectDatabases_Call) RunAndReturn(run func(ctx context.Context, domainName string) ([]domain.DBInfo, error)) *MockBackupService_DetectDatabases_Call {
106	_c.Call.Return(run)
107	return _c
108}
109
110// ListBackups provides a mock function for the type MockBackupService
111func (_mock *MockBackupService) ListBackups(ctx context.Context, domainName string) ([]domain.BackupJob, error) {
112	ret := _mock.Called(ctx, domainName)
113
114	if len(ret) == 0 {
115		panic("no return value specified for ListBackups")
116	}
117
118	var r0 []domain.BackupJob
119	var r1 error
120	if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]domain.BackupJob, error)); ok {
121		return returnFunc(ctx, domainName)
122	}
123	if returnFunc, ok := ret.Get(0).(func(context.Context, string) []domain.BackupJob); ok {
124		r0 = returnFunc(ctx, domainName)
125	} else {
126		if ret.Get(0) != nil {
127			r0 = ret.Get(0).([]domain.BackupJob)
128		}
129	}
130	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
131		r1 = returnFunc(ctx, domainName)
132	} else {
133		r1 = ret.Error(1)
134	}
135	return r0, r1
136}
137
138// MockBackupService_ListBackups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListBackups'
139type MockBackupService_ListBackups_Call struct {
140	*mock.Call
141}
142
143// ListBackups is a helper method to define mock.On call
144//   - ctx context.Context
145//   - domainName string
146func (_e *MockBackupService_Expecter) ListBackups(ctx interface{}, domainName interface{}) *MockBackupService_ListBackups_Call {
147	return &MockBackupService_ListBackups_Call{Call: _e.mock.On("ListBackups", ctx, domainName)}
148}
149
150func (_c *MockBackupService_ListBackups_Call) Run(run func(ctx context.Context, domainName string)) *MockBackupService_ListBackups_Call {
151	_c.Call.Run(func(args mock.Arguments) {
152		var arg0 context.Context
153		if args[0] != nil {
154			arg0 = args[0].(context.Context)
155		}
156		var arg1 string
157		if args[1] != nil {
158			arg1 = args[1].(string)
159		}
160		run(
161			arg0,
162			arg1,
163		)
164	})
165	return _c
166}
167
168func (_c *MockBackupService_ListBackups_Call) Return(backupJobs []domain.BackupJob, err error) *MockBackupService_ListBackups_Call {
169	_c.Call.Return(backupJobs, err)
170	return _c
171}
172
173func (_c *MockBackupService_ListBackups_Call) RunAndReturn(run func(ctx context.Context, domainName string) ([]domain.BackupJob, error)) *MockBackupService_ListBackups_Call {
174	_c.Call.Return(run)
175	return _c
176}
177
178// Restore provides a mock function for the type MockBackupService
179func (_mock *MockBackupService) Restore(ctx context.Context, domainName string, backupID string) error {
180	ret := _mock.Called(ctx, domainName, backupID)
181
182	if len(ret) == 0 {
183		panic("no return value specified for Restore")
184	}
185
186	var r0 error
187	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
188		r0 = returnFunc(ctx, domainName, backupID)
189	} else {
190		r0 = ret.Error(0)
191	}
192	return r0
193}
194
195// MockBackupService_Restore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Restore'
196type MockBackupService_Restore_Call struct {
197	*mock.Call
198}
199
200// Restore is a helper method to define mock.On call
201//   - ctx context.Context
202//   - domainName string
203//   - backupID string
204func (_e *MockBackupService_Expecter) Restore(ctx interface{}, domainName interface{}, backupID interface{}) *MockBackupService_Restore_Call {
205	return &MockBackupService_Restore_Call{Call: _e.mock.On("Restore", ctx, domainName, backupID)}
206}
207
208func (_c *MockBackupService_Restore_Call) Run(run func(ctx context.Context, domainName string, backupID string)) *MockBackupService_Restore_Call {
209	_c.Call.Run(func(args mock.Arguments) {
210		var arg0 context.Context
211		if args[0] != nil {
212			arg0 = args[0].(context.Context)
213		}
214		var arg1 string
215		if args[1] != nil {
216			arg1 = args[1].(string)
217		}
218		var arg2 string
219		if args[2] != nil {
220			arg2 = args[2].(string)
221		}
222		run(
223			arg0,
224			arg1,
225			arg2,
226		)
227	})
228	return _c
229}
230
231func (_c *MockBackupService_Restore_Call) Return(err error) *MockBackupService_Restore_Call {
232	_c.Call.Return(err)
233	return _c
234}
235
236func (_c *MockBackupService_Restore_Call) RunAndReturn(run func(ctx context.Context, domainName string, backupID string) error) *MockBackupService_Restore_Call {
237	_c.Call.Return(run)
238	return _c
239}
240
241// RestorePITR provides a mock function for the type MockBackupService
242func (_mock *MockBackupService) RestorePITR(ctx context.Context, domainName string, targetTime time.Time) error {
243	ret := _mock.Called(ctx, domainName, targetTime)
244
245	if len(ret) == 0 {
246		panic("no return value specified for RestorePITR")
247	}
248
249	var r0 error
250	if returnFunc, ok := ret.Get(0).(func(context.Context, string, time.Time) error); ok {
251		r0 = returnFunc(ctx, domainName, targetTime)
252	} else {
253		r0 = ret.Error(0)
254	}
255	return r0
256}
257
258// MockBackupService_RestorePITR_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestorePITR'
259type MockBackupService_RestorePITR_Call struct {
260	*mock.Call
261}
262
263// RestorePITR is a helper method to define mock.On call
264//   - ctx context.Context
265//   - domainName string
266//   - targetTime time.Time
267func (_e *MockBackupService_Expecter) RestorePITR(ctx interface{}, domainName interface{}, targetTime interface{}) *MockBackupService_RestorePITR_Call {
268	return &MockBackupService_RestorePITR_Call{Call: _e.mock.On("RestorePITR", ctx, domainName, targetTime)}
269}
270
271func (_c *MockBackupService_RestorePITR_Call) Run(run func(ctx context.Context, domainName string, targetTime time.Time)) *MockBackupService_RestorePITR_Call {
272	_c.Call.Run(func(args mock.Arguments) {
273		var arg0 context.Context
274		if args[0] != nil {
275			arg0 = args[0].(context.Context)
276		}
277		var arg1 string
278		if args[1] != nil {
279			arg1 = args[1].(string)
280		}
281		var arg2 time.Time
282		if args[2] != nil {
283			arg2 = args[2].(time.Time)
284		}
285		run(
286			arg0,
287			arg1,
288			arg2,
289		)
290	})
291	return _c
292}
293
294func (_c *MockBackupService_RestorePITR_Call) Return(err error) *MockBackupService_RestorePITR_Call {
295	_c.Call.Return(err)
296	return _c
297}
298
299func (_c *MockBackupService_RestorePITR_Call) RunAndReturn(run func(ctx context.Context, domainName string, targetTime time.Time) error) *MockBackupService_RestorePITR_Call {
300	_c.Call.Return(run)
301	return _c
302}
303
304// RunBackup provides a mock function for the type MockBackupService
305func (_mock *MockBackupService) RunBackup(ctx context.Context, domainName string, dbName string) (*domain.BackupResult, error) {
306	ret := _mock.Called(ctx, domainName, dbName)
307
308	if len(ret) == 0 {
309		panic("no return value specified for RunBackup")
310	}
311
312	var r0 *domain.BackupResult
313	var r1 error
314	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*domain.BackupResult, error)); ok {
315		return returnFunc(ctx, domainName, dbName)
316	}
317	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *domain.BackupResult); ok {
318		r0 = returnFunc(ctx, domainName, dbName)
319	} else {
320		if ret.Get(0) != nil {
321			r0 = ret.Get(0).(*domain.BackupResult)
322		}
323	}
324	if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
325		r1 = returnFunc(ctx, domainName, dbName)
326	} else {
327		r1 = ret.Error(1)
328	}
329	return r0, r1
330}
331
332// MockBackupService_RunBackup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunBackup'
333type MockBackupService_RunBackup_Call struct {
334	*mock.Call
335}
336
337// RunBackup is a helper method to define mock.On call
338//   - ctx context.Context
339//   - domainName string
340//   - dbName string
341func (_e *MockBackupService_Expecter) RunBackup(ctx interface{}, domainName interface{}, dbName interface{}) *MockBackupService_RunBackup_Call {
342	return &MockBackupService_RunBackup_Call{Call: _e.mock.On("RunBackup", ctx, domainName, dbName)}
343}
344
345func (_c *MockBackupService_RunBackup_Call) Run(run func(ctx context.Context, domainName string, dbName string)) *MockBackupService_RunBackup_Call {
346	_c.Call.Run(func(args mock.Arguments) {
347		var arg0 context.Context
348		if args[0] != nil {
349			arg0 = args[0].(context.Context)
350		}
351		var arg1 string
352		if args[1] != nil {
353			arg1 = args[1].(string)
354		}
355		var arg2 string
356		if args[2] != nil {
357			arg2 = args[2].(string)
358		}
359		run(
360			arg0,
361			arg1,
362			arg2,
363		)
364	})
365	return _c
366}
367
368func (_c *MockBackupService_RunBackup_Call) Return(backupResult *domain.BackupResult, err error) *MockBackupService_RunBackup_Call {
369	_c.Call.Return(backupResult, err)
370	return _c
371}
372
373func (_c *MockBackupService_RunBackup_Call) RunAndReturn(run func(ctx context.Context, domainName string, dbName string) (*domain.BackupResult, error)) *MockBackupService_RunBackup_Call {
374	_c.Call.Return(run)
375	return _c
376}
377
378// Status provides a mock function for the type MockBackupService
379func (_mock *MockBackupService) Status(ctx context.Context) ([]domain.BackupJob, error) {
380	ret := _mock.Called(ctx)
381
382	if len(ret) == 0 {
383		panic("no return value specified for Status")
384	}
385
386	var r0 []domain.BackupJob
387	var r1 error
388	if returnFunc, ok := ret.Get(0).(func(context.Context) ([]domain.BackupJob, error)); ok {
389		return returnFunc(ctx)
390	}
391	if returnFunc, ok := ret.Get(0).(func(context.Context) []domain.BackupJob); ok {
392		r0 = returnFunc(ctx)
393	} else {
394		if ret.Get(0) != nil {
395			r0 = ret.Get(0).([]domain.BackupJob)
396		}
397	}
398	if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
399		r1 = returnFunc(ctx)
400	} else {
401		r1 = ret.Error(1)
402	}
403	return r0, r1
404}
405
406// MockBackupService_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status'
407type MockBackupService_Status_Call struct {
408	*mock.Call
409}
410
411// Status is a helper method to define mock.On call
412//   - ctx context.Context
413func (_e *MockBackupService_Expecter) Status(ctx interface{}) *MockBackupService_Status_Call {
414	return &MockBackupService_Status_Call{Call: _e.mock.On("Status", ctx)}
415}
416
417func (_c *MockBackupService_Status_Call) Run(run func(ctx context.Context)) *MockBackupService_Status_Call {
418	_c.Call.Run(func(args mock.Arguments) {
419		var arg0 context.Context
420		if args[0] != nil {
421			arg0 = args[0].(context.Context)
422		}
423		run(
424			arg0,
425		)
426	})
427	return _c
428}
429
430func (_c *MockBackupService_Status_Call) Return(backupJobs []domain.BackupJob, err error) *MockBackupService_Status_Call {
431	_c.Call.Return(backupJobs, err)
432	return _c
433}
434
435func (_c *MockBackupService_Status_Call) RunAndReturn(run func(ctx context.Context) ([]domain.BackupJob, error)) *MockBackupService_Status_Call {
436	_c.Call.Return(run)
437	return _c
438}

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