-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
APIClient.go
422 lines (346 loc) · 13.2 KB
/
APIClient.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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
// Code generated by mockery v2.33.0. DO NOT EDIT.
package mocks
import (
context "context"
container "github.com/docker/docker/api/types/container"
io "io"
mock "github.com/stretchr/testify/mock"
network "github.com/docker/docker/api/types/network"
types "github.com/docker/docker/api/types"
v1 "github.com/opencontainers/image-spec/specs-go/v1"
)
// APIClient is an autogenerated mock type for the APIClient type
type APIClient struct {
mock.Mock
}
// ContainerCreate provides a mock function with given fields: ctx, config, hostConfig, networkingConfig, platform, containerName
func (_m *APIClient) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *v1.Platform, containerName string) (container.CreateResponse, error) {
ret := _m.Called(ctx, config, hostConfig, networkingConfig, platform, containerName)
var r0 container.CreateResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *container.Config, *container.HostConfig, *network.NetworkingConfig, *v1.Platform, string) (container.CreateResponse, error)); ok {
return rf(ctx, config, hostConfig, networkingConfig, platform, containerName)
}
if rf, ok := ret.Get(0).(func(context.Context, *container.Config, *container.HostConfig, *network.NetworkingConfig, *v1.Platform, string) container.CreateResponse); ok {
r0 = rf(ctx, config, hostConfig, networkingConfig, platform, containerName)
} else {
r0 = ret.Get(0).(container.CreateResponse)
}
if rf, ok := ret.Get(1).(func(context.Context, *container.Config, *container.HostConfig, *network.NetworkingConfig, *v1.Platform, string) error); ok {
r1 = rf(ctx, config, hostConfig, networkingConfig, platform, containerName)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ContainerExecAttach provides a mock function with given fields: ctx, execID, config
func (_m *APIClient) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error) {
ret := _m.Called(ctx, execID, config)
var r0 types.HijackedResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, types.ExecStartCheck) (types.HijackedResponse, error)); ok {
return rf(ctx, execID, config)
}
if rf, ok := ret.Get(0).(func(context.Context, string, types.ExecStartCheck) types.HijackedResponse); ok {
r0 = rf(ctx, execID, config)
} else {
r0 = ret.Get(0).(types.HijackedResponse)
}
if rf, ok := ret.Get(1).(func(context.Context, string, types.ExecStartCheck) error); ok {
r1 = rf(ctx, execID, config)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ContainerExecCreate provides a mock function with given fields: ctx, _a1, config
func (_m *APIClient) ContainerExecCreate(ctx context.Context, _a1 string, config types.ExecConfig) (types.IDResponse, error) {
ret := _m.Called(ctx, _a1, config)
var r0 types.IDResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, types.ExecConfig) (types.IDResponse, error)); ok {
return rf(ctx, _a1, config)
}
if rf, ok := ret.Get(0).(func(context.Context, string, types.ExecConfig) types.IDResponse); ok {
r0 = rf(ctx, _a1, config)
} else {
r0 = ret.Get(0).(types.IDResponse)
}
if rf, ok := ret.Get(1).(func(context.Context, string, types.ExecConfig) error); ok {
r1 = rf(ctx, _a1, config)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ContainerExecInspect provides a mock function with given fields: ctx, execID
func (_m *APIClient) ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error) {
ret := _m.Called(ctx, execID)
var r0 types.ContainerExecInspect
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (types.ContainerExecInspect, error)); ok {
return rf(ctx, execID)
}
if rf, ok := ret.Get(0).(func(context.Context, string) types.ContainerExecInspect); ok {
r0 = rf(ctx, execID)
} else {
r0 = ret.Get(0).(types.ContainerExecInspect)
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, execID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ContainerInspect provides a mock function with given fields: ctx, _a1
func (_m *APIClient) ContainerInspect(ctx context.Context, _a1 string) (types.ContainerJSON, error) {
ret := _m.Called(ctx, _a1)
var r0 types.ContainerJSON
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (types.ContainerJSON, error)); ok {
return rf(ctx, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, string) types.ContainerJSON); ok {
r0 = rf(ctx, _a1)
} else {
r0 = ret.Get(0).(types.ContainerJSON)
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ContainerList provides a mock function with given fields: ctx, options
func (_m *APIClient) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) {
ret := _m.Called(ctx, options)
var r0 []types.Container
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, types.ContainerListOptions) ([]types.Container, error)); ok {
return rf(ctx, options)
}
if rf, ok := ret.Get(0).(func(context.Context, types.ContainerListOptions) []types.Container); ok {
r0 = rf(ctx, options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]types.Container)
}
}
if rf, ok := ret.Get(1).(func(context.Context, types.ContainerListOptions) error); ok {
r1 = rf(ctx, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ContainerLogs provides a mock function with given fields: ctx, _a1, options
func (_m *APIClient) ContainerLogs(ctx context.Context, _a1 string, options types.ContainerLogsOptions) (io.ReadCloser, error) {
ret := _m.Called(ctx, _a1, options)
var r0 io.ReadCloser
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, types.ContainerLogsOptions) (io.ReadCloser, error)); ok {
return rf(ctx, _a1, options)
}
if rf, ok := ret.Get(0).(func(context.Context, string, types.ContainerLogsOptions) io.ReadCloser); ok {
r0 = rf(ctx, _a1, options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(io.ReadCloser)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, types.ContainerLogsOptions) error); ok {
r1 = rf(ctx, _a1, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ContainerRemove provides a mock function with given fields: ctx, _a1, options
func (_m *APIClient) ContainerRemove(ctx context.Context, _a1 string, options types.ContainerRemoveOptions) error {
ret := _m.Called(ctx, _a1, options)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, types.ContainerRemoveOptions) error); ok {
r0 = rf(ctx, _a1, options)
} else {
r0 = ret.Error(0)
}
return r0
}
// ContainerStart provides a mock function with given fields: ctx, _a1, options
func (_m *APIClient) ContainerStart(ctx context.Context, _a1 string, options types.ContainerStartOptions) error {
ret := _m.Called(ctx, _a1, options)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, types.ContainerStartOptions) error); ok {
r0 = rf(ctx, _a1, options)
} else {
r0 = ret.Error(0)
}
return r0
}
// ContainerStop provides a mock function with given fields: ctx, name, options
func (_m *APIClient) ContainerStop(ctx context.Context, name string, options container.StopOptions) error {
ret := _m.Called(ctx, name, options)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, container.StopOptions) error); ok {
r0 = rf(ctx, name, options)
} else {
r0 = ret.Error(0)
}
return r0
}
// ContainerWait provides a mock function with given fields: ctx, _a1, condition
func (_m *APIClient) ContainerWait(ctx context.Context, _a1 string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error) {
ret := _m.Called(ctx, _a1, condition)
var r0 <-chan container.WaitResponse
var r1 <-chan error
if rf, ok := ret.Get(0).(func(context.Context, string, container.WaitCondition) (<-chan container.WaitResponse, <-chan error)); ok {
return rf(ctx, _a1, condition)
}
if rf, ok := ret.Get(0).(func(context.Context, string, container.WaitCondition) <-chan container.WaitResponse); ok {
r0 = rf(ctx, _a1, condition)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(<-chan container.WaitResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, container.WaitCondition) <-chan error); ok {
r1 = rf(ctx, _a1, condition)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(<-chan error)
}
}
return r0, r1
}
// ImageList provides a mock function with given fields: ctx, options
func (_m *APIClient) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error) {
ret := _m.Called(ctx, options)
var r0 []types.ImageSummary
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, types.ImageListOptions) ([]types.ImageSummary, error)); ok {
return rf(ctx, options)
}
if rf, ok := ret.Get(0).(func(context.Context, types.ImageListOptions) []types.ImageSummary); ok {
r0 = rf(ctx, options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]types.ImageSummary)
}
}
if rf, ok := ret.Get(1).(func(context.Context, types.ImageListOptions) error); ok {
r1 = rf(ctx, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ImagePull provides a mock function with given fields: ctx, ref, options
func (_m *APIClient) ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error) {
ret := _m.Called(ctx, ref, options)
var r0 io.ReadCloser
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, types.ImagePullOptions) (io.ReadCloser, error)); ok {
return rf(ctx, ref, options)
}
if rf, ok := ret.Get(0).(func(context.Context, string, types.ImagePullOptions) io.ReadCloser); ok {
r0 = rf(ctx, ref, options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(io.ReadCloser)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, types.ImagePullOptions) error); ok {
r1 = rf(ctx, ref, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ImageRemove provides a mock function with given fields: ctx, image, options
func (_m *APIClient) ImageRemove(ctx context.Context, image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) {
ret := _m.Called(ctx, image, options)
var r0 []types.ImageDeleteResponseItem
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error)); ok {
return rf(ctx, image, options)
}
if rf, ok := ret.Get(0).(func(context.Context, string, types.ImageRemoveOptions) []types.ImageDeleteResponseItem); ok {
r0 = rf(ctx, image, options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]types.ImageDeleteResponseItem)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, types.ImageRemoveOptions) error); ok {
r1 = rf(ctx, image, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NetworkCreate provides a mock function with given fields: ctx, name, options
func (_m *APIClient) NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) {
ret := _m.Called(ctx, name, options)
var r0 types.NetworkCreateResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, types.NetworkCreate) (types.NetworkCreateResponse, error)); ok {
return rf(ctx, name, options)
}
if rf, ok := ret.Get(0).(func(context.Context, string, types.NetworkCreate) types.NetworkCreateResponse); ok {
r0 = rf(ctx, name, options)
} else {
r0 = ret.Get(0).(types.NetworkCreateResponse)
}
if rf, ok := ret.Get(1).(func(context.Context, string, types.NetworkCreate) error); ok {
r1 = rf(ctx, name, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NetworkList provides a mock function with given fields: ctx, options
func (_m *APIClient) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) {
ret := _m.Called(ctx, options)
var r0 []types.NetworkResource
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, types.NetworkListOptions) ([]types.NetworkResource, error)); ok {
return rf(ctx, options)
}
if rf, ok := ret.Get(0).(func(context.Context, types.NetworkListOptions) []types.NetworkResource); ok {
r0 = rf(ctx, options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]types.NetworkResource)
}
}
if rf, ok := ret.Get(1).(func(context.Context, types.NetworkListOptions) error); ok {
r1 = rf(ctx, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NetworkRemove provides a mock function with given fields: ctx, _a1
func (_m *APIClient) NetworkRemove(ctx context.Context, _a1 string) error {
ret := _m.Called(ctx, _a1)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, _a1)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewAPIClient creates a new instance of APIClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewAPIClient(t interface {
mock.TestingT
Cleanup(func())
}) *APIClient {
mock := &APIClient{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}