github.com/kobeld/docker@v1.12.0-rc1/api/client/plugin/set.go (about)

     1  // +build experimental
     2  
     3  package plugin
     4  
     5  import (
     6  	"golang.org/x/net/context"
     7  
     8  	"github.com/docker/docker/api/client"
     9  	"github.com/docker/docker/cli"
    10  	"github.com/spf13/cobra"
    11  )
    12  
    13  func newSetCommand(dockerCli *client.DockerCli) *cobra.Command {
    14  	cmd := &cobra.Command{
    15  		Use:   "set",
    16  		Short: "Change settings for a plugin",
    17  		Args:  cli.RequiresMinArgs(2),
    18  		RunE: func(cmd *cobra.Command, args []string) error {
    19  			return runSet(dockerCli, args[0], args[1:])
    20  		},
    21  	}
    22  
    23  	return cmd
    24  }
    25  
    26  func runSet(dockerCli *client.DockerCli, name string, args []string) error {
    27  	return dockerCli.Client().PluginSet(context.Background(), name, args)
    28  }