Skip to content

Commit

Permalink
[Clean] build lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
purplesmoke05 committed Feb 7, 2018
1 parent 7c9fb31 commit 268ba48
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 5 deletions.
86 changes: 81 additions & 5 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ type PluginPrivilege struct {
Value []string `json:"Value,omitempty" yaml:"Value,omitempty" toml:"Value,omitempty"`
}

// InstallPluginOptions This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type InstallPluginOptions struct {
Remote string
Name string
Plugins []PluginPrivilege
Context context.Context
}

// ListContainers returns a slice of containers matching the given criteria.
// InstallPlugins returns a slice of containers matching the given criteria.
//
// See https://goo.gl/kaOHGw for more details.
func (c *Client) InstallPlugins(opts InstallPluginOptions, auth AuthConfiguration) (error) {
Expand All @@ -46,50 +49,80 @@ func (c *Client) InstallPlugins(opts InstallPluginOptions, auth AuthConfiguratio
return nil
}

// PluginSetting This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type PluginSetting struct {
Env []string `json:"Env,omitempty" yaml:"Env,omitempty" toml:"Env,omitempty"`
Args []string `json:"Args,omitempty" yaml:"Args,omitempty" toml:"Args,omitempty"`
Devices []string `json:"Devices,omitempty" yaml:"Devices,omitempty" toml:"Devices,omitempty"`
}

// PluginInterface This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type PluginInterface struct {
Types []string `json:"Types,omitempty" yaml:"Types,omitempty" toml:"Types,omitempty"`
Socket string `json:"Socket,omitempty" yaml:"Socket,omitempty" toml:"Socket,omitempty"`
}

// PluginNetwork This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type PluginNetwork struct {
Type string `json:"Type,omitempty" yaml:"Type,omitempty" toml:"Type,omitempty"`
}

// PluginLinux This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type PluginLinux struct {
Capabilities []string `json:"Capabilities,omitempty" yaml:"Capabilities,omitempty" toml:"Capabilities,omitempty"`
AllowAllDevices bool `json:"AllowAllDevices,omitempty" yaml:"AllowAllDevices,omitempty" toml:"AllowAllDevices,omitempty"`
Devices []PluginLinuxDevices `json:"Devices,omitempty" yaml:"Devices,omitempty" toml:"Devices,omitempty"`
}

// PluginLinuxDevices This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type PluginLinuxDevices struct {
Name string `json:"Name,omitempty" yaml:"Name,omitempty" toml:"Name,omitempty"`
Description string `json:"Documentation,omitempty" yaml:"Documentation,omitempty" toml:"Documentation,omitempty"`
Settable []string `json:"Settable,omitempty" yaml:"Settable,omitempty" toml:"Settable,omitempty"`
Path string `json:"Path,omitempty" yaml:"Path,omitempty" toml:"Path,omitempty"`
}

// PluginEnv This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type PluginEnv struct {
Name string `json:"Name,omitempty" yaml:"Name,omitempty" toml:"Name,omitempty"`
Description string `json:"Documentation,omitempty" yaml:"Documentation,omitempty" toml:"Documentation,omitempty"`
Settable []string `json:"Settable,omitempty" yaml:"Settable,omitempty" toml:"Settable,omitempty"`
Value string `json:"Value,omitempty" yaml:"Value,omitempty" toml:"Value,omitempty"`
}

// PluginArgs This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type PluginArgs struct {
Name string `json:"Name,omitempty" yaml:"Name,omitempty" toml:"Name,omitempty"`
Description string `json:"Documentation,omitempty" yaml:"Documentation,omitempty" toml:"Documentation,omitempty"`
Settable []string `json:"Settable,omitempty" yaml:"Settable,omitempty" toml:"Settable,omitempty"`
Value []string `json:"Value,omitempty" yaml:"Value,omitempty" toml:"Value,omitempty"`
}

// PluginUser This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type PluginUser struct {
UID int32 `json:"UID,omitempty" yaml:"UID,omitempty" toml:"UID,omitempty"`
GID int32 `json:"GID,omitempty" yaml:"GID,omitempty" toml:"GID,omitempty"`
}

// PluginConfig This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type PluginConfig struct {
Description string `json:"Description,omitempty" yaml:"Description,omitempty" toml:"Description,omitempty"`
Documentation string
Expand All @@ -99,21 +132,27 @@ type PluginConfig struct {
User PluginUser `json:"User,omitempty" yaml:"User,omitempty" toml:"User,omitempty"`
Network PluginNetwork `json:"Network,omitempty" yaml:"Network,omitempty" toml:"Network,omitempty"`
Linux PluginLinux `json:"Linux,omitempty" yaml:"Linux,omitempty" toml:"Linux,omitempty"`
PropagatedMount string `json:"Interface,omitempty" yaml:"Interface,omitempty" toml:"Interface,omitempty"`
PropagatedMount string `json:"PropagatedMount,omitempty" yaml:"PropagatedMount,omitempty" toml:"PropagatedMount,omitempty"`
Mounts []Mount `json:"Mounts,omitempty" yaml:"Mounts,omitempty" toml:"Mounts,omitempty"`
Env []PluginEnv `json:"Env,omitempty" yaml:"Env,omitempty" toml:"Env,omitempty"`
Args PluginArgs `json:"Args,omitempty" yaml:"Args,omitempty" toml:"Args,omitempty"`
}

// PluginDetail This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type PluginDetail struct {
Id string `json:"Id,omitempty" yaml:"Id,omitempty" toml:"Id,omitempty"`
ID string `json:"Id,omitempty" yaml:"Id,omitempty" toml:"Id,omitempty"`
Name string `json:"Name,omitempty" yaml:"Name,omitempty" toml:"Name,omitempty"`
Tag string `json:"Tag,omitempty" yaml:"Tag,omitempty" toml:"Tag,omitempty"`
Active bool `json:"Active,omitempty" yaml:"Active,omitempty" toml:"Active,omitempty"`
Settings PluginSetting `json:"Settings,omitempty" yaml:"Settings,omitempty" toml:"Settings,omitempty"`
Config Config `json:"Config,omitempty" yaml:"Config,omitempty" toml:"Config,omitempty"`
}

// ListPlugins This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
func (c *Client) ListPlugins()([]PluginDetail, error) {
resp, err := c.do("GET", "/plugins",doOptions{})
if err != nil {
Expand All @@ -127,7 +166,9 @@ func (c *Client) ListPlugins()([]PluginDetail, error) {
return pluginDetails, nil
}


// GetPluginPrivileges This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
func (c *Client) GetPluginPrivileges(name string)([]PluginPrivilege, error) {
resp, err := c.do("GET", "/plugins/privileges?"+name,doOptions{})
if err != nil {
Expand All @@ -141,6 +182,9 @@ func (c *Client) GetPluginPrivileges(name string)([]PluginPrivilege, error) {
return pluginPrivileges, nil
}

// RemovePluginOptions This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type RemovePluginOptions struct {
// The ID of the container.
Name string `qs:"-"`
Expand All @@ -151,6 +195,9 @@ type RemovePluginOptions struct {
Context context.Context
}

// RemovePlugin This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
func (c *Client) RemovePlugin(opts RemovePluginOptions)(*PluginDetail, error) {
path := "/plugins/"+opts.Name+"?"+queryString(opts)
resp, err := c.do("DELETE", path, doOptions{context: opts.Context})
Expand All @@ -172,7 +219,9 @@ func (c *Client) RemovePlugin(opts RemovePluginOptions)(*PluginDetail, error) {
return &pluginDetail, nil
}


// EnablePluginOptions This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type EnablePluginOptions struct {
// The ID of the container.
Name string `qs:"-"`
Expand All @@ -181,6 +230,9 @@ type EnablePluginOptions struct {
Context context.Context
}

// EnablePlugin This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
func (c *Client) EnablePlugin(opts EnablePluginOptions)(error) {
path := "/plugins/"+opts.Name+"/enable?"+queryString(opts)
resp, err := c.do("POST", path, doOptions{context: opts.Context})
Expand All @@ -192,13 +244,19 @@ func (c *Client) EnablePlugin(opts EnablePluginOptions)(error) {
return nil
}

// DisablePluginOptions This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type DisablePluginOptions struct {
// The ID of the container.
Name string `qs:"-"`

Context context.Context
}

// DisablePlugin This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
func (c *Client) DisablePlugin(opts DisablePluginOptions)(error) {
path := "/plugins/"+opts.Name+"/disable"
resp, err := c.do("POST", path, doOptions{context: opts.Context})
Expand All @@ -210,6 +268,9 @@ func (c *Client) DisablePlugin(opts DisablePluginOptions)(error) {
return nil
}

// CreatePluginOptions This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type CreatePluginOptions struct {
// The Name of the container.
Name string `qs:"name"`
Expand All @@ -219,6 +280,9 @@ type CreatePluginOptions struct {
Context context.Context
}

// CreatePlugin This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
func (c *Client) CreatePlugin(opts CreatePluginOptions)(string,error) {
path := "/plugins/create?"+queryString(opts.Name)
resp, err := c.do("POST", path, doOptions{
Expand All @@ -235,13 +299,19 @@ func (c *Client) CreatePlugin(opts CreatePluginOptions)(string,error) {
return string(containerNameBytes),nil
}

// PushPluginOptions This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type PushPluginOptions struct {
// The Name of the container.
Name string

Context context.Context
}

// PushPlugin This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
func (c *Client) PushPlugin(opts PushPluginOptions)(error) {
path := "/plugins/"+opts.Name+"/push"
resp, err := c.do("POST", path, doOptions{context: opts.Context})
Expand All @@ -252,6 +322,9 @@ func (c *Client) PushPlugin(opts PushPluginOptions)(error) {
return nil
}

// ConfigurePluginOptions This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
type ConfigurePluginOptions struct {
// The Name of the container.
Name string `qs:"name"`
Expand All @@ -260,6 +333,9 @@ type ConfigurePluginOptions struct {
Context context.Context
}

// ConfigurePlugin This is a TBD Comments.
//
// See https://goo.gl/kaOHGw for more details.
func (c *Client) ConfigurePlugin(opts ConfigurePluginOptions)(error) {
path := "/plugins/"+opts.Name+"/set"
resp, err := c.do("POST", path, doOptions{
Expand Down
1 change: 1 addition & 0 deletions plugins_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package docker

0 comments on commit 268ba48

Please sign in to comment.