-
Notifications
You must be signed in to change notification settings - Fork 330
/
repository.go
125 lines (102 loc) · 3.06 KB
/
repository.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// Code generated by mockery v1.0.0. DO NOT EDIT.
package mocks
import (
context "context"
model "github.com/opensds/multi-cloud/backend/pkg/model"
mock "github.com/stretchr/testify/mock"
)
// Repository is an autogenerated mock type for the Repository type
type Repository struct {
mock.Mock
}
// Close provides a mock function with given fields:
func (_m *Repository) Close() {
_m.Called()
}
// CreateBackend provides a mock function with given fields: ctx, backend
func (_m *Repository) CreateBackend(ctx context.Context, backend *model.Backend) (*model.Backend, error) {
ret := _m.Called(ctx, backend)
var r0 *model.Backend
if rf, ok := ret.Get(0).(func(context.Context, *model.Backend) *model.Backend); ok {
r0 = rf(ctx, backend)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Backend)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *model.Backend) error); ok {
r1 = rf(ctx, backend)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DeleteBackend provides a mock function with given fields: ctx, id
func (_m *Repository) DeleteBackend(ctx context.Context, id string) error {
ret := _m.Called(ctx, id)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, id)
} else {
r0 = ret.Error(0)
}
return r0
}
// GetBackend provides a mock function with given fields: ctx, id
func (_m *Repository) GetBackend(ctx context.Context, id string) (*model.Backend, error) {
ret := _m.Called(ctx, id)
var r0 *model.Backend
if rf, ok := ret.Get(0).(func(context.Context, string) *model.Backend); ok {
r0 = rf(ctx, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Backend)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ListBackend provides a mock function with given fields: ctx, limit, offset, query
func (_m *Repository) ListBackend(ctx context.Context, limit int, offset int, query interface{}) ([]*model.Backend, error) {
ret := _m.Called(ctx, limit, offset, query)
var r0 []*model.Backend
if rf, ok := ret.Get(0).(func(context.Context, int, int, interface{}) []*model.Backend); ok {
r0 = rf(ctx, limit, offset, query)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.Backend)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int, int, interface{}) error); ok {
r1 = rf(ctx, limit, offset, query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// UpdateBackend provides a mock function with given fields: ctx, backend
func (_m *Repository) UpdateBackend(ctx context.Context, backend *model.Backend) (*model.Backend, error) {
ret := _m.Called(ctx, backend)
var r0 *model.Backend
if rf, ok := ret.Get(0).(func(context.Context, *model.Backend) *model.Backend); ok {
r0 = rf(ctx, backend)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Backend)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *model.Backend) error); ok {
r1 = rf(ctx, backend)
} else {
r1 = ret.Error(1)
}
return r0, r1
}