{"modulePath":"github.com/rancher/docker-cli","version":"v0.0.0-20190201110649-896ff57b300c","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package manager\n\n## Constants\n\n```go\nconst (\n\t// CommandAnnotationPlugin is added to every stub command added by\n\t// AddPluginCommandStubs with the value \"true\" and so can be\n\t// used to distinguish plugin stubs from regular commands.\n\tCommandAnnotationPlugin = \"com.docker.cli.plugin\"\n\n\t// CommandAnnotationPluginVendor is added to every stub command\n\t// added by AddPluginCommandStubs and contains the vendor of\n\t// that plugin.\n\tCommandAnnotationPluginVendor = \"com.docker.cli.plugin.vendor\"\n\n\t// CommandAnnotationPluginInvalid is added to any stub command\n\t// added by AddPluginCommandStubs for an invalid command (that\n\t// is, one which failed it's candidate test) and contains the\n\t// reason for the failure.\n\tCommandAnnotationPluginInvalid = \"com.docker.cli.plugin-invalid\"\n)\n```\n\n```go\nconst (\n\t// NamePrefix is the prefix required on all plugin binary names\n\tNamePrefix = \"docker-\"\n\n\t// MetadataSubcommandName is the name of the plugin subcommand\n\t// which must be supported by every plugin and returns the\n\t// plugin metadata.\n\tMetadataSubcommandName = \"docker-cli-plugin-metadata\"\n)\n```\n\n## Functions\n\n```go\nfunc AddPluginCommandStubs(dockerCli command.Cli, cmd *cobra.Command) error\n```\nAddPluginCommandStubs adds a stub cobra.Commands for each valid and invalid plugin. The command stubs will have several annotations added, see \\`CommandAnnotationPlugin\\*\\`.\n\n```go\nfunc IsNotFound(err error) bool\n```\nIsNotFound is true if the given error is due to a plugin not being found.\n\n```go\nfunc NewPluginError(msg string, args ...interface{}) error\n```\nNewPluginError creates a new pluginError, analogous to errors.Errorf.\n\n```go\nfunc PluginRunCommand(dockerCli command.Cli, name string, rootcmd *cobra.Command) (*exec.Cmd, error)\n```\nPluginRunCommand returns an \"os/exec\".Cmd which when .Run() will execute the named plugin. The rootcmd argument is referenced to determine the set of builtin commands in order to detect conficts. The error returned satisfies the IsNotFound() predicate if no plugin was found or if the first candidate plugin was invalid somehow.\n\n## Types\n\n```go\ntype Candidate interface {\n\tPath() string\n\tMetadata() ([]byte, error)\n}\n```\nCandidate represents a possible plugin candidate, for mocking purposes\n\n```go\ntype Metadata struct {\n\t// SchemaVersion describes the version of this struct. Mandatory, must be \"0.1.0\"\n\tSchemaVersion string `json:\",omitempty\"`\n\t// Vendor is the name of the plugin vendor. Mandatory\n\tVendor string `json:\",omitempty\"`\n\t// Version is the optional version of this plugin.\n\tVersion string `json:\",omitempty\"`\n\t// ShortDescription should be suitable for a single line help message.\n\tShortDescription string `json:\",omitempty\"`\n\t// URL is a pointer to the plugin's homepage.\n\tURL string `json:\",omitempty\"`\n}\n```\nMetadata provided by the plugin. See docs/extend/cli\\_plugins.md for canonical information.\n\n```go\ntype Plugin struct {\n\tMetadata\n\n\tName string `json:\",omitempty\"`\n\tPath string `json:\",omitempty\"`\n\n\t// Err is non-nil if the plugin failed one of the candidate tests.\n\tErr error `json:\",omitempty\"`\n\n\t// ShadowedPaths contains the paths of any other plugins which this plugin takes precedence over.\n\tShadowedPaths []string `json:\",omitempty\"`\n}\n```\nPlugin represents a potential plugin with all it's metadata.\n\n```go\nfunc ListPlugins(dockerCli command.Cli, rootcmd *cobra.Command) ([]Plugin, error)\n```\nListPlugins produces a list of the plugins available on the system\n\n","path":"github.com/rancher/docker-cli/cli-plugins/manager","name":"manager","synopsis":"","isRedistributable":true}
