@@ -20,7 +20,7 @@ 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 . This is a TBD Comments.
24
24
//
25
25
// See https://goo.gl/kaOHGw for more details.
26
26
type InstallPluginOptions struct {
@@ -51,7 +51,7 @@ func (c *Client) InstallPlugins(opts InstallPluginOptions, auth AuthConfiguratio
51
51
return nil
52
52
}
53
53
54
- // PluginSetting This is a TBD Comments.
54
+ // PluginSetting . This is a TBD Comments.
55
55
//
56
56
// See https://goo.gl/kaOHGw for more details.
57
57
type PluginSetting struct {
@@ -60,22 +60,22 @@ type PluginSetting struct {
60
60
Devices []string `json:"Devices,omitempty" yaml:"Devices,omitempty" toml:"Devices,omitempty"`
61
61
}
62
62
63
- // PluginInterface This is a TBD Comments.
63
+ // PluginInterface . This is a TBD Comments.
64
64
//
65
65
// See https://goo.gl/kaOHGw for more details.
66
66
type PluginInterface struct {
67
67
Types []string `json:"Types,omitempty" yaml:"Types,omitempty" toml:"Types,omitempty"`
68
68
Socket string `json:"Socket,omitempty" yaml:"Socket,omitempty" toml:"Socket,omitempty"`
69
69
}
70
70
71
- // PluginNetwork This is a TBD Comments.
71
+ // PluginNetwork . This is a TBD Comments.
72
72
//
73
73
// See https://goo.gl/kaOHGw for more details.
74
74
type PluginNetwork struct {
75
75
Type string `json:"Type,omitempty" yaml:"Type,omitempty" toml:"Type,omitempty"`
76
76
}
77
77
78
- // PluginLinux This is a TBD Comments.
78
+ // PluginLinux . This is a TBD Comments.
79
79
//
80
80
// See https://goo.gl/kaOHGw for more details.
81
81
type PluginLinux struct {
@@ -84,7 +84,7 @@ type PluginLinux struct {
84
84
Devices []PluginLinuxDevices `json:"Devices,omitempty" yaml:"Devices,omitempty" toml:"Devices,omitempty"`
85
85
}
86
86
87
- // PluginLinuxDevices This is a TBD Comments.
87
+ // PluginLinuxDevices . This is a TBD Comments.
88
88
//
89
89
// See https://goo.gl/kaOHGw for more details.
90
90
type PluginLinuxDevices struct {
@@ -94,35 +94,35 @@ type PluginLinuxDevices struct {
94
94
Path string `json:"Path,omitempty" yaml:"Path,omitempty" toml:"Path,omitempty"`
95
95
}
96
96
97
- // PluginEnv This is a TBD Comments.
97
+ // PluginEnv . This is a TBD Comments.
98
98
//
99
99
// See https://goo.gl/kaOHGw for more details.
100
100
type PluginEnv struct {
101
101
Name string `json:"Name,omitempty" yaml:"Name,omitempty" toml:"Name,omitempty"`
102
- Description string `json:"Documentation ,omitempty" yaml:"Documentation ,omitempty" toml:"Documentation ,omitempty"`
102
+ Description string `json:"Description ,omitempty" yaml:"Description ,omitempty" toml:"Description ,omitempty"`
103
103
Settable []string `json:"Settable,omitempty" yaml:"Settable,omitempty" toml:"Settable,omitempty"`
104
104
Value string `json:"Value,omitempty" yaml:"Value,omitempty" toml:"Value,omitempty"`
105
105
}
106
106
107
- // PluginArgs This is a TBD Comments.
107
+ // PluginArgs . This is a TBD Comments.
108
108
//
109
109
// See https://goo.gl/kaOHGw for more details.
110
110
type PluginArgs struct {
111
111
Name string `json:"Name,omitempty" yaml:"Name,omitempty" toml:"Name,omitempty"`
112
- Description string `json:"Documentation ,omitempty" yaml:"Documentation ,omitempty" toml:"Documentation ,omitempty"`
112
+ Description string `json:"Description ,omitempty" yaml:"Description ,omitempty" toml:"Description ,omitempty"`
113
113
Settable []string `json:"Settable,omitempty" yaml:"Settable,omitempty" toml:"Settable,omitempty"`
114
114
Value []string `json:"Value,omitempty" yaml:"Value,omitempty" toml:"Value,omitempty"`
115
115
}
116
116
117
- // PluginUser This is a TBD Comments.
117
+ // PluginUser . This is a TBD Comments.
118
118
//
119
119
// See https://goo.gl/kaOHGw for more details.
120
120
type PluginUser struct {
121
121
UID int32 `json:"UID,omitempty" yaml:"UID,omitempty" toml:"UID,omitempty"`
122
122
GID int32 `json:"GID,omitempty" yaml:"GID,omitempty" toml:"GID,omitempty"`
123
123
}
124
124
125
- // PluginConfig This is a TBD Comments.
125
+ // PluginConfig . This is a TBD Comments.
126
126
//
127
127
// See https://goo.gl/kaOHGw for more details.
128
128
type PluginConfig struct {
@@ -140,7 +140,7 @@ type PluginConfig struct {
140
140
Args PluginArgs `json:"Args,omitempty" yaml:"Args,omitempty" toml:"Args,omitempty"`
141
141
}
142
142
143
- // PluginDetail This is a TBD Comments.
143
+ // PluginDetail . This is a TBD Comments.
144
144
//
145
145
// See https://goo.gl/kaOHGw for more details.
146
146
type PluginDetail struct {
@@ -152,7 +152,7 @@ type PluginDetail struct {
152
152
Config PluginConfig `json:"Config,omitempty" yaml:"Config,omitempty" toml:"Config,omitempty"`
153
153
}
154
154
155
- // ListPlugins This is a TBD Comments.
155
+ // ListPlugins . This is a TBD Comments.
156
156
//
157
157
// See https://goo.gl/kaOHGw for more details.
158
158
func (c * Client ) ListPlugins () ([]PluginDetail , error ) {
@@ -168,7 +168,7 @@ func (c *Client) ListPlugins() ([]PluginDetail, error) {
168
168
return pluginDetails , nil
169
169
}
170
170
171
- // GetPluginPrivileges This is a TBD Comments.
171
+ // GetPluginPrivileges . This is a TBD Comments.
172
172
//
173
173
// See https://goo.gl/kaOHGw for more details.
174
174
func (c * Client ) GetPluginPrivileges (name string ) ([]PluginPrivilege , error ) {
@@ -177,14 +177,37 @@ func (c *Client) GetPluginPrivileges(name string) ([]PluginPrivilege, error) {
177
177
return nil , err
178
178
}
179
179
defer resp .Body .Close ()
180
- pluginPrivileges := make ( []PluginPrivilege , 0 )
180
+ var pluginPrivileges []PluginPrivilege
181
181
if err := json .NewDecoder (resp .Body ).Decode (& pluginPrivileges ); err != nil {
182
182
return nil , err
183
183
}
184
184
return pluginPrivileges , nil
185
185
}
186
186
187
- // RemovePluginOptions This is a TBD Comments.
187
+ // InspectPlugins .This is a TBD Comments.
188
+ //
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 {})
192
+ if err != nil {
193
+ return nil , err
194
+ }
195
+ defer resp .Body .Close ()
196
+ if err != nil {
197
+ if e , ok := err .(* Error ); ok && e .Status == http .StatusNotFound {
198
+ return nil , & NoSuchPlugin {ID : name }
199
+ }
200
+ return nil , err
201
+ }
202
+ resp .Body .Close ()
203
+ var pluginDetail PluginDetail
204
+ if err := json .NewDecoder (resp .Body ).Decode (& pluginDetail ); err != nil {
205
+ return nil , err
206
+ }
207
+ return & pluginDetail , nil
208
+ }
209
+
210
+ // RemovePluginOptions .This is a TBD Comments.
188
211
//
189
212
// See https://goo.gl/kaOHGw for more details.
190
213
type RemovePluginOptions struct {
@@ -197,7 +220,7 @@ type RemovePluginOptions struct {
197
220
Context context.Context
198
221
}
199
222
200
- // RemovePlugin This is a TBD Comments.
223
+ // RemovePlugin . This is a TBD Comments.
201
224
//
202
225
// See https://goo.gl/kaOHGw for more details.
203
226
func (c * Client ) RemovePlugin (opts RemovePluginOptions ) (* PluginDetail , error ) {
@@ -221,7 +244,7 @@ func (c *Client) RemovePlugin(opts RemovePluginOptions) (*PluginDetail, error) {
221
244
return & pluginDetail , nil
222
245
}
223
246
224
- // EnablePluginOptions This is a TBD Comments.
247
+ // EnablePluginOptions . This is a TBD Comments.
225
248
//
226
249
// See https://goo.gl/kaOHGw for more details.
227
250
type EnablePluginOptions struct {
@@ -232,7 +255,7 @@ type EnablePluginOptions struct {
232
255
Context context.Context
233
256
}
234
257
235
- // EnablePlugin This is a TBD Comments.
258
+ // EnablePlugin . This is a TBD Comments.
236
259
//
237
260
// See https://goo.gl/kaOHGw for more details.
238
261
func (c * Client ) EnablePlugin (opts EnablePluginOptions ) error {
@@ -246,7 +269,7 @@ func (c *Client) EnablePlugin(opts EnablePluginOptions) error {
246
269
return nil
247
270
}
248
271
249
- // DisablePluginOptions This is a TBD Comments.
272
+ // DisablePluginOptions . This is a TBD Comments.
250
273
//
251
274
// See https://goo.gl/kaOHGw for more details.
252
275
type DisablePluginOptions struct {
@@ -256,7 +279,7 @@ type DisablePluginOptions struct {
256
279
Context context.Context
257
280
}
258
281
259
- // DisablePlugin This is a TBD Comments.
282
+ // DisablePlugin . This is a TBD Comments.
260
283
//
261
284
// See https://goo.gl/kaOHGw for more details.
262
285
func (c * Client ) DisablePlugin (opts DisablePluginOptions ) error {
@@ -270,7 +293,7 @@ func (c *Client) DisablePlugin(opts DisablePluginOptions) error {
270
293
return nil
271
294
}
272
295
273
- // CreatePluginOptions This is a TBD Comments.
296
+ // CreatePluginOptions . This is a TBD Comments.
274
297
//
275
298
// See https://goo.gl/kaOHGw for more details.
276
299
type CreatePluginOptions struct {
@@ -282,7 +305,7 @@ type CreatePluginOptions struct {
282
305
Context context.Context
283
306
}
284
307
285
- // CreatePlugin This is a TBD Comments.
308
+ // CreatePlugin . This is a TBD Comments.
286
309
//
287
310
// See https://goo.gl/kaOHGw for more details.
288
311
func (c * Client ) CreatePlugin (opts CreatePluginOptions ) (string , error ) {
@@ -301,7 +324,7 @@ func (c *Client) CreatePlugin(opts CreatePluginOptions) (string, error) {
301
324
return string (containerNameBytes ), nil
302
325
}
303
326
304
- // PushPluginOptions This is a TBD Comments.
327
+ // PushPluginOptions . This is a TBD Comments.
305
328
//
306
329
// See https://goo.gl/kaOHGw for more details.
307
330
type PushPluginOptions struct {
@@ -311,7 +334,7 @@ type PushPluginOptions struct {
311
334
Context context.Context
312
335
}
313
336
314
- // PushPlugin This is a TBD Comments.
337
+ // PushPlugin . This is a TBD Comments.
315
338
//
316
339
// See https://goo.gl/kaOHGw for more details.
317
340
func (c * Client ) PushPlugin (opts PushPluginOptions ) error {
@@ -324,7 +347,7 @@ func (c *Client) PushPlugin(opts PushPluginOptions) error {
324
347
return nil
325
348
}
326
349
327
- // ConfigurePluginOptions This is a TBD Comments.
350
+ // ConfigurePluginOptions . This is a TBD Comments.
328
351
//
329
352
// See https://goo.gl/kaOHGw for more details.
330
353
type ConfigurePluginOptions struct {
@@ -335,7 +358,7 @@ type ConfigurePluginOptions struct {
335
358
Context context.Context
336
359
}
337
360
338
- // ConfigurePlugin This is a TBD Comments.
361
+ // ConfigurePlugin . This is a TBD Comments.
339
362
//
340
363
// See https://goo.gl/kaOHGw for more details.
341
364
func (c * Client ) ConfigurePlugin (opts ConfigurePluginOptions ) error {
0 commit comments