@@ -20,20 +20,23 @@ type PluginPrivilege struct {
20
20
Value []string `json:"Value,omitempty" yaml:"Value,omitempty" toml:"Value,omitempty"`
21
21
}
22
22
23
- // InstallPluginOptions .This is a TBD Comments.
23
+ // InstallPluginOptions
24
24
//
25
- // See https://goo.gl/kaOHGw for more details.
25
+ // See https://goo.gl/C4t7Tz for more details.
26
26
type InstallPluginOptions struct {
27
27
Remote string
28
28
Name string
29
- Plugins []PluginPrivilege
29
+ Plugins []PluginPrivilege `qs:"-"`
30
+
31
+ Auth AuthConfiguration
32
+
30
33
Context context.Context
31
34
}
32
35
33
- // InstallPlugins returns a slice of containers matching the given criteria .
36
+ // InstallPlugins installs a plugin or returns an error in case of failure .
34
37
//
35
- // See https://goo.gl/kaOHGw for more details.
36
- func (c * Client ) InstallPlugins (opts InstallPluginOptions , auth AuthConfiguration ) error {
38
+ // See https://goo.gl/C4t7Tz for more details.
39
+ func (c * Client ) InstallPlugins (opts InstallPluginOptions ) error {
37
40
params := make (url.Values )
38
41
params .Set ("remote" , opts .Remote )
39
42
if opts .Name != "" {
@@ -51,80 +54,80 @@ func (c *Client) InstallPlugins(opts InstallPluginOptions, auth AuthConfiguratio
51
54
return nil
52
55
}
53
56
54
- // PluginSetting .This is a TBD Comments .
57
+ // PluginSetting stores plugin settings .
55
58
//
56
- // See https://goo.gl/kaOHGw for more details.
57
- type PluginSetting struct {
59
+ // See https://goo.gl/C4t7Tz for more details.
60
+ type PluginSettings struct {
58
61
Env []string `json:"Env,omitempty" yaml:"Env,omitempty" toml:"Env,omitempty"`
59
62
Args []string `json:"Args,omitempty" yaml:"Args,omitempty" toml:"Args,omitempty"`
60
63
Devices []string `json:"Devices,omitempty" yaml:"Devices,omitempty" toml:"Devices,omitempty"`
61
64
}
62
65
63
- // PluginInterface .This is a TBD Comments .
66
+ // PluginInterface stores plugin interface .
64
67
//
65
- // See https://goo.gl/kaOHGw for more details.
68
+ // See https://goo.gl/C4t7Tz for more details.
66
69
type PluginInterface struct {
67
70
Types []string `json:"Types,omitempty" yaml:"Types,omitempty" toml:"Types,omitempty"`
68
71
Socket string `json:"Socket,omitempty" yaml:"Socket,omitempty" toml:"Socket,omitempty"`
69
72
}
70
73
71
- // PluginNetwork .This is a TBD Comments .
74
+ // PluginNetwork stores plugin network type .
72
75
//
73
- // See https://goo.gl/kaOHGw for more details.
76
+ // See https://goo.gl/C4t7Tz for more details.
74
77
type PluginNetwork struct {
75
78
Type string `json:"Type,omitempty" yaml:"Type,omitempty" toml:"Type,omitempty"`
76
79
}
77
80
78
- // PluginLinux .This is a TBD Comments .
81
+ // PluginLinux stores plugin linux setting .
79
82
//
80
- // See https://goo.gl/kaOHGw for more details.
83
+ // See https://goo.gl/C4t7Tz for more details.
81
84
type PluginLinux struct {
82
85
Capabilities []string `json:"Capabilities,omitempty" yaml:"Capabilities,omitempty" toml:"Capabilities,omitempty"`
83
86
AllowAllDevices bool `json:"AllowAllDevices,omitempty" yaml:"AllowAllDevices,omitempty" toml:"AllowAllDevices,omitempty"`
84
87
Devices []PluginLinuxDevices `json:"Devices,omitempty" yaml:"Devices,omitempty" toml:"Devices,omitempty"`
85
88
}
86
89
87
- // PluginLinuxDevices .This is a TBD Comments .
90
+ // PluginLinuxDevices stores plugin linux device setting .
88
91
//
89
- // See https://goo.gl/kaOHGw for more details.
92
+ // See https://goo.gl/C4t7Tz for more details.
90
93
type PluginLinuxDevices struct {
91
94
Name string `json:"Name,omitempty" yaml:"Name,omitempty" toml:"Name,omitempty"`
92
95
Description string `json:"Documentation,omitempty" yaml:"Documentation,omitempty" toml:"Documentation,omitempty"`
93
96
Settable []string `json:"Settable,omitempty" yaml:"Settable,omitempty" toml:"Settable,omitempty"`
94
97
Path string `json:"Path,omitempty" yaml:"Path,omitempty" toml:"Path,omitempty"`
95
98
}
96
99
97
- // PluginEnv .This is a TBD Comments .
100
+ // PluginEnv stores plugin environment .
98
101
//
99
- // See https://goo.gl/kaOHGw for more details.
102
+ // See https://goo.gl/C4t7Tz for more details.
100
103
type PluginEnv struct {
101
104
Name string `json:"Name,omitempty" yaml:"Name,omitempty" toml:"Name,omitempty"`
102
105
Description string `json:"Description,omitempty" yaml:"Description,omitempty" toml:"Description,omitempty"`
103
106
Settable []string `json:"Settable,omitempty" yaml:"Settable,omitempty" toml:"Settable,omitempty"`
104
107
Value string `json:"Value,omitempty" yaml:"Value,omitempty" toml:"Value,omitempty"`
105
108
}
106
109
107
- // PluginArgs .This is a TBD Comments .
110
+ // PluginArgs stores plugin arguments .
108
111
//
109
- // See https://goo.gl/kaOHGw for more details.
112
+ // See https://goo.gl/C4t7Tz for more details.
110
113
type PluginArgs struct {
111
114
Name string `json:"Name,omitempty" yaml:"Name,omitempty" toml:"Name,omitempty"`
112
115
Description string `json:"Description,omitempty" yaml:"Description,omitempty" toml:"Description,omitempty"`
113
116
Settable []string `json:"Settable,omitempty" yaml:"Settable,omitempty" toml:"Settable,omitempty"`
114
117
Value []string `json:"Value,omitempty" yaml:"Value,omitempty" toml:"Value,omitempty"`
115
118
}
116
119
117
- // PluginUser .This is a TBD Comments .
120
+ // PluginUser stores plugin user .
118
121
//
119
- // See https://goo.gl/kaOHGw for more details.
122
+ // See https://goo.gl/C4t7Tz for more details.
120
123
type PluginUser struct {
121
124
UID int32 `json:"UID,omitempty" yaml:"UID,omitempty" toml:"UID,omitempty"`
122
125
GID int32 `json:"GID,omitempty" yaml:"GID,omitempty" toml:"GID,omitempty"`
123
126
}
124
127
125
- // PluginConfig .This is a TBD Comments .
128
+ // PluginConfig stores plugin config .
126
129
//
127
- // See https://goo.gl/kaOHGw for more details.
130
+ // See https://goo.gl/C4t7Tz for more details.
128
131
type PluginConfig struct {
129
132
Description string `json:"Description,omitempty" yaml:"Description,omitempty" toml:"Description,omitempty"`
130
133
Documentation string
@@ -140,23 +143,26 @@ type PluginConfig struct {
140
143
Args PluginArgs `json:"Args,omitempty" yaml:"Args,omitempty" toml:"Args,omitempty"`
141
144
}
142
145
143
- // PluginDetail .This is a TBD Comments .
146
+ // PluginDetail specify results from the ListPlugins function .
144
147
//
145
- // See https://goo.gl/kaOHGw for more details.
148
+ // See https://goo.gl/C4t7Tz for more details.
146
149
type PluginDetail struct {
147
150
ID string `json:"Id,omitempty" yaml:"Id,omitempty" toml:"Id,omitempty"`
148
151
Name string `json:"Name,omitempty" yaml:"Name,omitempty" toml:"Name,omitempty"`
149
152
Tag string `json:"Tag,omitempty" yaml:"Tag,omitempty" toml:"Tag,omitempty"`
150
153
Active bool `json:"Active,omitempty" yaml:"Active,omitempty" toml:"Active,omitempty"`
151
- Settings PluginSetting `json:"Settings,omitempty" yaml:"Settings,omitempty" toml:"Settings,omitempty"`
154
+ Settings PluginSettings `json:"Settings,omitempty" yaml:"Settings,omitempty" toml:"Settings,omitempty"`
152
155
Config PluginConfig `json:"Config,omitempty" yaml:"Config,omitempty" toml:"Config,omitempty"`
153
156
}
154
157
155
- // ListPlugins .This is a TBD Comments .
158
+ // ListPlugins returns pluginDetails or an error .
156
159
//
157
- // See https://goo.gl/kaOHGw for more details.
158
- func (c * Client ) ListPlugins () ([]PluginDetail , error ) {
159
- resp , err := c .do ("GET" , "/plugins" , doOptions {})
160
+ // See https://goo.gl/C4t7Tz for more details.
161
+ func (c * Client ) ListPlugins (ctx context.Context ) ([]PluginDetail , error ) {
162
+ resp , err := c .do ("GET" , "/plugins" , doOptions {
163
+ context :ctx ,
164
+
165
+ })
160
166
if err != nil {
161
167
return nil , err
162
168
}
@@ -168,11 +174,13 @@ func (c *Client) ListPlugins() ([]PluginDetail, error) {
168
174
return pluginDetails , nil
169
175
}
170
176
171
- // GetPluginPrivileges .This is a TBD Comments .
177
+ // GetPluginPrivileges returns pulginPrivileges or an error .
172
178
//
173
- // See https://goo.gl/kaOHGw for more details.
174
- func (c * Client ) GetPluginPrivileges (name string ) ([]PluginPrivilege , error ) {
175
- resp , err := c .do ("GET" , "/plugins/privileges?" + name , doOptions {})
179
+ // See https://goo.gl/C4t7Tz for more details.
180
+ func (c * Client ) GetPluginPrivileges (name string ,ctx context.Context ) ([]PluginPrivilege , error ) {
181
+ resp , err := c .do ("GET" , "/plugins/privileges?remote=" + name , doOptions {
182
+ context :ctx ,
183
+ })
176
184
if err != nil {
177
185
return nil , err
178
186
}
@@ -184,11 +192,13 @@ func (c *Client) GetPluginPrivileges(name string) ([]PluginPrivilege, error) {
184
192
return pluginPrivileges , nil
185
193
}
186
194
187
- // InspectPlugins .This is a TBD Comments .
195
+ // InspectPlugins returns a pluginDetail or an error .
188
196
//
189
- // See https://goo.gl/kaOHGw for more details.
190
- func (c * Client ) InspectPlugins (name string ) (* PluginDetail , error ) {
191
- resp , err := c .do ("GET" , "/plugins/" + name + "/json" , doOptions {})
197
+ // See https://goo.gl/C4t7Tz for more details.
198
+ func (c * Client ) InspectPlugins (name string , ctx context.Context ) (* PluginDetail , error ) {
199
+ resp , err := c .do ("GET" , "/plugins/" + name + "/json" , doOptions {
200
+ context :ctx ,
201
+ })
192
202
if err != nil {
193
203
return nil , err
194
204
}
@@ -207,22 +217,20 @@ func (c *Client) InspectPlugins(name string) (*PluginDetail, error) {
207
217
return & pluginDetail , nil
208
218
}
209
219
210
- // RemovePluginOptions .This is a TBD Comments .
220
+ // RemovePluginOptions specify parameters to the RemovePlugin function .
211
221
//
212
- // See https://goo.gl/kaOHGw for more details.
222
+ // See https://goo.gl/C4t7Tz for more details.
213
223
type RemovePluginOptions struct {
214
- // The ID of the container .
224
+ // The Name of the plugin .
215
225
Name string `qs:"-"`
216
226
217
- // A flag that indicates whether Docker should remove the plugin
218
- // even if it is currently used.
219
227
Force bool `qs:"force"`
220
228
Context context.Context
221
229
}
222
230
223
- // RemovePlugin .This is a TBD Comments .
231
+ // RemovePlugin returns a PluginDetail or an error .
224
232
//
225
- // See https://goo.gl/kaOHGw for more details.
233
+ // See https://goo.gl/C4t7Tz for more details.
226
234
func (c * Client ) RemovePlugin (opts RemovePluginOptions ) (* PluginDetail , error ) {
227
235
path := "/plugins/" + opts .Name + "?" + queryString (opts )
228
236
resp , err := c .do ("DELETE" , path , doOptions {context : opts .Context })
@@ -244,20 +252,20 @@ func (c *Client) RemovePlugin(opts RemovePluginOptions) (*PluginDetail, error) {
244
252
return & pluginDetail , nil
245
253
}
246
254
247
- // EnablePluginOptions .This is a TBD Comments .
255
+ // EnablePluginOptions specify parameters to the EnablePlugin function .
248
256
//
249
- // See https://goo.gl/kaOHGw for more details.
257
+ // See https://goo.gl/C4t7Tz for more details.
250
258
type EnablePluginOptions struct {
251
- // The ID of the container .
259
+ // The Name of the plugin .
252
260
Name string `qs:"-"`
253
261
Timeout int64 `qs:"timeout"`
254
262
255
263
Context context.Context
256
264
}
257
265
258
- // EnablePlugin .This is a TBD Comments .
266
+ // EnablePlugin enables plugin that opts point or returns an error .
259
267
//
260
- // See https://goo.gl/kaOHGw for more details.
268
+ // See https://goo.gl/C4t7Tz for more details.
261
269
func (c * Client ) EnablePlugin (opts EnablePluginOptions ) error {
262
270
path := "/plugins/" + opts .Name + "/enable?" + queryString (opts )
263
271
resp , err := c .do ("POST" , path , doOptions {context : opts .Context })
@@ -269,19 +277,19 @@ func (c *Client) EnablePlugin(opts EnablePluginOptions) error {
269
277
return nil
270
278
}
271
279
272
- // DisablePluginOptions .This is a TBD Comments .
280
+ // DisablePluginOptions specify parameters to the DisablePlugin function .
273
281
//
274
- // See https://goo.gl/kaOHGw for more details.
282
+ // See https://goo.gl/C4t7Tz for more details.
275
283
type DisablePluginOptions struct {
276
- // The ID of the container .
284
+ // The Name of the plugin .
277
285
Name string `qs:"-"`
278
286
279
287
Context context.Context
280
288
}
281
289
282
- // DisablePlugin .This is a TBD Comments .
290
+ // DisablePlugin disables plugin that opts point or returns an error .
283
291
//
284
- // See https://goo.gl/kaOHGw for more details.
292
+ // See https://goo.gl/C4t7Tz for more details.
285
293
func (c * Client ) DisablePlugin (opts DisablePluginOptions ) error {
286
294
path := "/plugins/" + opts .Name + "/disable"
287
295
resp , err := c .do ("POST" , path , doOptions {context : opts .Context })
@@ -293,23 +301,23 @@ func (c *Client) DisablePlugin(opts DisablePluginOptions) error {
293
301
return nil
294
302
}
295
303
296
- // CreatePluginOptions .This is a TBD Comments .
304
+ // CreatePluginOptions specify parameters to the CreatePlugin function .
297
305
//
298
- // See https://goo.gl/kaOHGw for more details.
306
+ // See https://goo.gl/C4t7Tz for more details.
299
307
type CreatePluginOptions struct {
300
- // The Name of the container .
308
+ // The Name of the plugin .
301
309
Name string `qs:"name"`
302
310
// Path to tar containing plugin
303
311
Path string `qs:"-"`
304
312
305
313
Context context.Context
306
314
}
307
315
308
- // CreatePlugin .This is a TBD Comments .
316
+ // CreatePlugin creates plugin that opts point or returns an error .
309
317
//
310
- // See https://goo.gl/kaOHGw for more details.
318
+ // See https://goo.gl/C4t7Tz for more details.
311
319
func (c * Client ) CreatePlugin (opts CreatePluginOptions ) (string , error ) {
312
- path := "/plugins/create?" + queryString (opts . Name )
320
+ path := "/plugins/create?" + queryString (opts )
313
321
resp , err := c .do ("POST" , path , doOptions {
314
322
data : opts .Path ,
315
323
context : opts .Context })
@@ -324,19 +332,19 @@ func (c *Client) CreatePlugin(opts CreatePluginOptions) (string, error) {
324
332
return string (containerNameBytes ), nil
325
333
}
326
334
327
- // PushPluginOptions .This is a TBD Comments .
335
+ // PushPluginOptions specify parameters to PushPlugin function .
328
336
//
329
- // See https://goo.gl/kaOHGw for more details.
337
+ // See https://goo.gl/C4t7Tz for more details.
330
338
type PushPluginOptions struct {
331
- // The Name of the container .
339
+ // The Name of the plugin .
332
340
Name string
333
341
334
342
Context context.Context
335
343
}
336
344
337
- // PushPlugin .This is a TBD Comments .
345
+ // PushPlugin pushes plugin that opts point or returns an error .
338
346
//
339
- // See https://goo.gl/kaOHGw for more details.
347
+ // See https://goo.gl/C4t7Tz for more details.
340
348
func (c * Client ) PushPlugin (opts PushPluginOptions ) error {
341
349
path := "/plugins/" + opts .Name + "/push"
342
350
resp , err := c .do ("POST" , path , doOptions {context : opts .Context })
@@ -347,20 +355,20 @@ func (c *Client) PushPlugin(opts PushPluginOptions) error {
347
355
return nil
348
356
}
349
357
350
- // ConfigurePluginOptions .This is a TBD Comments.
358
+ // ConfigurePluginOptions specify parameters to the ConfigurePlugin
351
359
//
352
- // See https://goo.gl/kaOHGw for more details.
360
+ // See https://goo.gl/C4t7Tz for more details.
353
361
type ConfigurePluginOptions struct {
354
- // The Name of the container .
362
+ // The Name of the plugin .
355
363
Name string `qs:"name"`
356
364
Envs []string
357
365
358
366
Context context.Context
359
367
}
360
368
361
- // ConfigurePlugin .This is a TBD Comments .
369
+ // ConfigurePlugin configures plugin that opts point or returns an error .
362
370
//
363
- // See https://goo.gl/kaOHGw for more details.
371
+ // See https://goo.gl/C4t7Tz for more details.
364
372
func (c * Client ) ConfigurePlugin (opts ConfigurePluginOptions ) error {
365
373
path := "/plugins/" + opts .Name + "/set"
366
374
resp , err := c .do ("POST" , path , doOptions {
0 commit comments