This repository has been archived by the owner on Dec 26, 2023. It is now read-only.
/
PrivRegistryProvider.go
241 lines (196 loc) · 8.54 KB
/
PrivRegistryProvider.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
// Code generated by mockery v2.26.1. DO NOT EDIT.
package mocks
import (
context "context"
privregistry "github.com/ergomake/ergomake/internal/privregistry"
mock "github.com/stretchr/testify/mock"
uuid "github.com/google/uuid"
)
// PrivRegistryProvider is an autogenerated mock type for the PrivRegistryProvider type
type PrivRegistryProvider struct {
mock.Mock
}
type PrivRegistryProvider_Expecter struct {
mock *mock.Mock
}
func (_m *PrivRegistryProvider) EXPECT() *PrivRegistryProvider_Expecter {
return &PrivRegistryProvider_Expecter{mock: &_m.Mock}
}
// DeleteRegistry provides a mock function with given fields: ctx, id
func (_m *PrivRegistryProvider) DeleteRegistry(ctx context.Context, id uuid.UUID) error {
ret := _m.Called(ctx, id)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, uuid.UUID) error); ok {
r0 = rf(ctx, id)
} else {
r0 = ret.Error(0)
}
return r0
}
// PrivRegistryProvider_DeleteRegistry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteRegistry'
type PrivRegistryProvider_DeleteRegistry_Call struct {
*mock.Call
}
// DeleteRegistry is a helper method to define mock.On call
// - ctx context.Context
// - id uuid.UUID
func (_e *PrivRegistryProvider_Expecter) DeleteRegistry(ctx interface{}, id interface{}) *PrivRegistryProvider_DeleteRegistry_Call {
return &PrivRegistryProvider_DeleteRegistry_Call{Call: _e.mock.On("DeleteRegistry", ctx, id)}
}
func (_c *PrivRegistryProvider_DeleteRegistry_Call) Run(run func(ctx context.Context, id uuid.UUID)) *PrivRegistryProvider_DeleteRegistry_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uuid.UUID))
})
return _c
}
func (_c *PrivRegistryProvider_DeleteRegistry_Call) Return(_a0 error) *PrivRegistryProvider_DeleteRegistry_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *PrivRegistryProvider_DeleteRegistry_Call) RunAndReturn(run func(context.Context, uuid.UUID) error) *PrivRegistryProvider_DeleteRegistry_Call {
_c.Call.Return(run)
return _c
}
// FetchCreds provides a mock function with given fields: ctx, owner, image
func (_m *PrivRegistryProvider) FetchCreds(ctx context.Context, owner string, image string) (*privregistry.RegistryCreds, error) {
ret := _m.Called(ctx, owner, image)
var r0 *privregistry.RegistryCreds
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*privregistry.RegistryCreds, error)); ok {
return rf(ctx, owner, image)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string) *privregistry.RegistryCreds); ok {
r0 = rf(ctx, owner, image)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*privregistry.RegistryCreds)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = rf(ctx, owner, image)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PrivRegistryProvider_FetchCreds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchCreds'
type PrivRegistryProvider_FetchCreds_Call struct {
*mock.Call
}
// FetchCreds is a helper method to define mock.On call
// - ctx context.Context
// - owner string
// - image string
func (_e *PrivRegistryProvider_Expecter) FetchCreds(ctx interface{}, owner interface{}, image interface{}) *PrivRegistryProvider_FetchCreds_Call {
return &PrivRegistryProvider_FetchCreds_Call{Call: _e.mock.On("FetchCreds", ctx, owner, image)}
}
func (_c *PrivRegistryProvider_FetchCreds_Call) Run(run func(ctx context.Context, owner string, image string)) *PrivRegistryProvider_FetchCreds_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(string))
})
return _c
}
func (_c *PrivRegistryProvider_FetchCreds_Call) Return(_a0 *privregistry.RegistryCreds, _a1 error) *PrivRegistryProvider_FetchCreds_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *PrivRegistryProvider_FetchCreds_Call) RunAndReturn(run func(context.Context, string, string) (*privregistry.RegistryCreds, error)) *PrivRegistryProvider_FetchCreds_Call {
_c.Call.Return(run)
return _c
}
// ListCredsByOwner provides a mock function with given fields: ctx, owner, skipToken
func (_m *PrivRegistryProvider) ListCredsByOwner(ctx context.Context, owner string, skipToken bool) ([]privregistry.RegistryCreds, error) {
ret := _m.Called(ctx, owner, skipToken)
var r0 []privregistry.RegistryCreds
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, bool) ([]privregistry.RegistryCreds, error)); ok {
return rf(ctx, owner, skipToken)
}
if rf, ok := ret.Get(0).(func(context.Context, string, bool) []privregistry.RegistryCreds); ok {
r0 = rf(ctx, owner, skipToken)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]privregistry.RegistryCreds)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok {
r1 = rf(ctx, owner, skipToken)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PrivRegistryProvider_ListCredsByOwner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListCredsByOwner'
type PrivRegistryProvider_ListCredsByOwner_Call struct {
*mock.Call
}
// ListCredsByOwner is a helper method to define mock.On call
// - ctx context.Context
// - owner string
// - skipToken bool
func (_e *PrivRegistryProvider_Expecter) ListCredsByOwner(ctx interface{}, owner interface{}, skipToken interface{}) *PrivRegistryProvider_ListCredsByOwner_Call {
return &PrivRegistryProvider_ListCredsByOwner_Call{Call: _e.mock.On("ListCredsByOwner", ctx, owner, skipToken)}
}
func (_c *PrivRegistryProvider_ListCredsByOwner_Call) Run(run func(ctx context.Context, owner string, skipToken bool)) *PrivRegistryProvider_ListCredsByOwner_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(bool))
})
return _c
}
func (_c *PrivRegistryProvider_ListCredsByOwner_Call) Return(_a0 []privregistry.RegistryCreds, _a1 error) *PrivRegistryProvider_ListCredsByOwner_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *PrivRegistryProvider_ListCredsByOwner_Call) RunAndReturn(run func(context.Context, string, bool) ([]privregistry.RegistryCreds, error)) *PrivRegistryProvider_ListCredsByOwner_Call {
_c.Call.Return(run)
return _c
}
// StoreRegistry provides a mock function with given fields: ctx, owner, url, provider, credentials
func (_m *PrivRegistryProvider) StoreRegistry(ctx context.Context, owner string, url string, provider string, credentials string) error {
ret := _m.Called(ctx, owner, url, provider, credentials)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string) error); ok {
r0 = rf(ctx, owner, url, provider, credentials)
} else {
r0 = ret.Error(0)
}
return r0
}
// PrivRegistryProvider_StoreRegistry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StoreRegistry'
type PrivRegistryProvider_StoreRegistry_Call struct {
*mock.Call
}
// StoreRegistry is a helper method to define mock.On call
// - ctx context.Context
// - owner string
// - url string
// - provider string
// - credentials string
func (_e *PrivRegistryProvider_Expecter) StoreRegistry(ctx interface{}, owner interface{}, url interface{}, provider interface{}, credentials interface{}) *PrivRegistryProvider_StoreRegistry_Call {
return &PrivRegistryProvider_StoreRegistry_Call{Call: _e.mock.On("StoreRegistry", ctx, owner, url, provider, credentials)}
}
func (_c *PrivRegistryProvider_StoreRegistry_Call) Run(run func(ctx context.Context, owner string, url string, provider string, credentials string)) *PrivRegistryProvider_StoreRegistry_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(string))
})
return _c
}
func (_c *PrivRegistryProvider_StoreRegistry_Call) Return(_a0 error) *PrivRegistryProvider_StoreRegistry_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *PrivRegistryProvider_StoreRegistry_Call) RunAndReturn(run func(context.Context, string, string, string, string) error) *PrivRegistryProvider_StoreRegistry_Call {
_c.Call.Return(run)
return _c
}
type mockConstructorTestingTNewPrivRegistryProvider interface {
mock.TestingT
Cleanup(func())
}
// NewPrivRegistryProvider creates a new instance of PrivRegistryProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewPrivRegistryProvider(t mockConstructorTestingTNewPrivRegistryProvider) *PrivRegistryProvider {
mock := &PrivRegistryProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}