Skip to content

Commit

Permalink
plugin: fix year in license banner
Browse files Browse the repository at this point in the history
  • Loading branch information
fsouza committed Feb 12, 2018
1 parent e2a58e4 commit 2ac0f35
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
21 changes: 10 additions & 11 deletions plugin.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2013 go-dockerclient authors. All rights reserved.
// Copyright 2018 go-dockerclient authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

Expand Down Expand Up @@ -147,21 +147,20 @@ type PluginConfig struct {
//
// See https://goo.gl/C4t7Tz for more details.
type PluginDetail struct {
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"`
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 PluginSettings `json:"Settings,omitempty" yaml:"Settings,omitempty" toml:"Settings,omitempty"`
Config PluginConfig `json:"Config,omitempty" yaml:"Config,omitempty" toml:"Config,omitempty"`
Config PluginConfig `json:"Config,omitempty" yaml:"Config,omitempty" toml:"Config,omitempty"`
}

// ListPlugins returns pluginDetails or an error.
//
// See https://goo.gl/C4t7Tz for more details.
func (c *Client) ListPlugins(ctx context.Context) ([]PluginDetail, error) {
resp, err := c.do("GET", "/plugins", doOptions{
context:ctx,

context: ctx,
})
if err != nil {
return nil, err
Expand All @@ -177,9 +176,9 @@ func (c *Client) ListPlugins(ctx context.Context) ([]PluginDetail, error) {
// GetPluginPrivileges returns pulginPrivileges or an error.
//
// See https://goo.gl/C4t7Tz for more details.
func (c *Client) GetPluginPrivileges(name string,ctx context.Context) ([]PluginPrivilege, error) {
func (c *Client) GetPluginPrivileges(name string, ctx context.Context) ([]PluginPrivilege, error) {
resp, err := c.do("GET", "/plugins/privileges?remote="+name, doOptions{
context:ctx,
context: ctx,
})
if err != nil {
return nil, err
Expand All @@ -197,7 +196,7 @@ func (c *Client) GetPluginPrivileges(name string,ctx context.Context) ([]PluginP
// See https://goo.gl/C4t7Tz for more details.
func (c *Client) InspectPlugins(name string, ctx context.Context) (*PluginDetail, error) {
resp, err := c.do("GET", "/plugins/"+name+"/json", doOptions{
context:ctx,
context: ctx,
})
if err != nil {
return nil, err
Expand Down
10 changes: 7 additions & 3 deletions plugins_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright 2018 go-dockerclient authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package docker

import (
Expand Down Expand Up @@ -196,7 +200,7 @@ func TestGetPluginPrivileges(t *testing.T) {
Description: "",
Value: []string{"host"},
}}
pluginPrivileges, err := client.GetPluginPrivileges(name,context.Background())
pluginPrivileges, err := client.GetPluginPrivileges(name, context.Background())
if err != nil {
t.Fatal(err)
}
Expand All @@ -216,7 +220,7 @@ func TestInstallPlugins(t *testing.T) {
},
},
Context: context.Background(),
Auth: AuthConfiguration{},
Auth: AuthConfiguration{},
}

client := newTestClient(&FakeRoundTripper{message: "", status: http.StatusOK})
Expand All @@ -230,7 +234,7 @@ func TestInspectPlugin(t *testing.T) {
name := "test_plugin"
fakeRT := &FakeRoundTripper{message: jsonPluginDetail, status: http.StatusNoContent}
client := newTestClient(fakeRT)
pluginPrivileges, err := client.InspectPlugins(name,context.Background())
pluginPrivileges, err := client.InspectPlugins(name, context.Background())
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 2ac0f35

Please sign in to comment.