-
Notifications
You must be signed in to change notification settings - Fork 51
/
storage.go
309 lines (261 loc) · 10.3 KB
/
storage.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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/openshift/openshift-azure/pkg/util/azureclient/storage (interfaces: Client,BlobStorageClient,Container,Blob)
// Package mock_storage is a generated GoMock package.
package mock_storage
import (
io "io"
reflect "reflect"
storage "github.com/Azure/azure-sdk-for-go/storage"
gomock "github.com/golang/mock/gomock"
storage0 "github.com/openshift/openshift-azure/pkg/util/azureclient/storage"
)
// MockClient is a mock of Client interface
type MockClient struct {
ctrl *gomock.Controller
recorder *MockClientMockRecorder
}
// MockClientMockRecorder is the mock recorder for MockClient
type MockClientMockRecorder struct {
mock *MockClient
}
// NewMockClient creates a new mock instance
func NewMockClient(ctrl *gomock.Controller) *MockClient {
mock := &MockClient{ctrl: ctrl}
mock.recorder = &MockClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockClient) EXPECT() *MockClientMockRecorder {
return m.recorder
}
// GetBlobService mocks base method
func (m *MockClient) GetBlobService() storage0.BlobStorageClient {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBlobService")
ret0, _ := ret[0].(storage0.BlobStorageClient)
return ret0
}
// GetBlobService indicates an expected call of GetBlobService
func (mr *MockClientMockRecorder) GetBlobService() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlobService", reflect.TypeOf((*MockClient)(nil).GetBlobService))
}
// MockBlobStorageClient is a mock of BlobStorageClient interface
type MockBlobStorageClient struct {
ctrl *gomock.Controller
recorder *MockBlobStorageClientMockRecorder
}
// MockBlobStorageClientMockRecorder is the mock recorder for MockBlobStorageClient
type MockBlobStorageClientMockRecorder struct {
mock *MockBlobStorageClient
}
// NewMockBlobStorageClient creates a new mock instance
func NewMockBlobStorageClient(ctrl *gomock.Controller) *MockBlobStorageClient {
mock := &MockBlobStorageClient{ctrl: ctrl}
mock.recorder = &MockBlobStorageClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockBlobStorageClient) EXPECT() *MockBlobStorageClientMockRecorder {
return m.recorder
}
// GetContainerReference mocks base method
func (m *MockBlobStorageClient) GetContainerReference(arg0 string) storage0.Container {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetContainerReference", arg0)
ret0, _ := ret[0].(storage0.Container)
return ret0
}
// GetContainerReference indicates an expected call of GetContainerReference
func (mr *MockBlobStorageClientMockRecorder) GetContainerReference(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContainerReference", reflect.TypeOf((*MockBlobStorageClient)(nil).GetContainerReference), arg0)
}
// MockContainer is a mock of Container interface
type MockContainer struct {
ctrl *gomock.Controller
recorder *MockContainerMockRecorder
}
// MockContainerMockRecorder is the mock recorder for MockContainer
type MockContainerMockRecorder struct {
mock *MockContainer
}
// NewMockContainer creates a new mock instance
func NewMockContainer(ctrl *gomock.Controller) *MockContainer {
mock := &MockContainer{ctrl: ctrl}
mock.recorder = &MockContainerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockContainer) EXPECT() *MockContainerMockRecorder {
return m.recorder
}
// CreateIfNotExists mocks base method
func (m *MockContainer) CreateIfNotExists(arg0 *storage.CreateContainerOptions) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateIfNotExists", arg0)
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateIfNotExists indicates an expected call of CreateIfNotExists
func (mr *MockContainerMockRecorder) CreateIfNotExists(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateIfNotExists", reflect.TypeOf((*MockContainer)(nil).CreateIfNotExists), arg0)
}
// Exists mocks base method
func (m *MockContainer) Exists() (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Exists")
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Exists indicates an expected call of Exists
func (mr *MockContainerMockRecorder) Exists() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exists", reflect.TypeOf((*MockContainer)(nil).Exists))
}
// GetBlobReference mocks base method
func (m *MockContainer) GetBlobReference(arg0 string) storage0.Blob {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBlobReference", arg0)
ret0, _ := ret[0].(storage0.Blob)
return ret0
}
// GetBlobReference indicates an expected call of GetBlobReference
func (mr *MockContainerMockRecorder) GetBlobReference(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlobReference", reflect.TypeOf((*MockContainer)(nil).GetBlobReference), arg0)
}
// ListBlobs mocks base method
func (m *MockContainer) ListBlobs(arg0 storage.ListBlobsParameters) (storage.BlobListResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListBlobs", arg0)
ret0, _ := ret[0].(storage.BlobListResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListBlobs indicates an expected call of ListBlobs
func (mr *MockContainerMockRecorder) ListBlobs(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListBlobs", reflect.TypeOf((*MockContainer)(nil).ListBlobs), arg0)
}
// MockBlob is a mock of Blob interface
type MockBlob struct {
ctrl *gomock.Controller
recorder *MockBlobMockRecorder
}
// MockBlobMockRecorder is the mock recorder for MockBlob
type MockBlobMockRecorder struct {
mock *MockBlob
}
// NewMockBlob creates a new mock instance
func NewMockBlob(ctrl *gomock.Controller) *MockBlob {
mock := &MockBlob{ctrl: ctrl}
mock.recorder = &MockBlobMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockBlob) EXPECT() *MockBlobMockRecorder {
return m.recorder
}
// CreateBlockBlob mocks base method
func (m *MockBlob) CreateBlockBlob(arg0 *storage.PutBlobOptions) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateBlockBlob", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// CreateBlockBlob indicates an expected call of CreateBlockBlob
func (mr *MockBlobMockRecorder) CreateBlockBlob(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBlockBlob", reflect.TypeOf((*MockBlob)(nil).CreateBlockBlob), arg0)
}
// CreateBlockBlobFromReader mocks base method
func (m *MockBlob) CreateBlockBlobFromReader(arg0 io.Reader, arg1 *storage.PutBlobOptions) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateBlockBlobFromReader", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// CreateBlockBlobFromReader indicates an expected call of CreateBlockBlobFromReader
func (mr *MockBlobMockRecorder) CreateBlockBlobFromReader(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBlockBlobFromReader", reflect.TypeOf((*MockBlob)(nil).CreateBlockBlobFromReader), arg0, arg1)
}
// Delete mocks base method
func (m *MockBlob) Delete(arg0 *storage.DeleteBlobOptions) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Delete", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Delete indicates an expected call of Delete
func (mr *MockBlobMockRecorder) Delete(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockBlob)(nil).Delete), arg0)
}
// Exists mocks base method
func (m *MockBlob) Exists() (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Exists")
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Exists indicates an expected call of Exists
func (mr *MockBlobMockRecorder) Exists() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exists", reflect.TypeOf((*MockBlob)(nil).Exists))
}
// Get mocks base method
func (m *MockBlob) Get(arg0 *storage.GetBlobOptions) (io.ReadCloser, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Get", arg0)
ret0, _ := ret[0].(io.ReadCloser)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Get indicates an expected call of Get
func (mr *MockBlobMockRecorder) Get(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockBlob)(nil).Get), arg0)
}
// GetSASURI mocks base method
func (m *MockBlob) GetSASURI(arg0 storage.BlobSASOptions) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetSASURI", arg0)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetSASURI indicates an expected call of GetSASURI
func (mr *MockBlobMockRecorder) GetSASURI(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSASURI", reflect.TypeOf((*MockBlob)(nil).GetSASURI), arg0)
}
// PutBlock mocks base method
func (m *MockBlob) PutBlock(arg0 string, arg1 []byte, arg2 *storage.PutBlockOptions) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PutBlock", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// PutBlock indicates an expected call of PutBlock
func (mr *MockBlobMockRecorder) PutBlock(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutBlock", reflect.TypeOf((*MockBlob)(nil).PutBlock), arg0, arg1, arg2)
}
// PutBlockList mocks base method
func (m *MockBlob) PutBlockList(arg0 []storage.Block, arg1 *storage.PutBlockListOptions) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PutBlockList", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// PutBlockList indicates an expected call of PutBlockList
func (mr *MockBlobMockRecorder) PutBlockList(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutBlockList", reflect.TypeOf((*MockBlob)(nil).PutBlockList), arg0, arg1)
}