{"modulePath":"github.com/rancher/docker-cli","version":"v0.0.0-20190201110649-896ff57b300c","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package command\n\n## Constants\n\n```go\nconst (\n\t// OrchestratorKubernetes orchestrator\n\tOrchestratorKubernetes = Orchestrator(\"kubernetes\")\n\t// OrchestratorSwarm orchestrator\n\tOrchestratorSwarm = Orchestrator(\"swarm\")\n\t// OrchestratorAll orchestrator\n\tOrchestratorAll = Orchestrator(\"all\")\n)\n```\n\n## Variables\n\n```go\nvar (\n\t// NewInStream returns a new InStream object from a ReadCloser\n\t// Deprecated: Use github.com/docker/cli/cli/streams.NewIn instead\n\tNewInStream = streams.NewIn\n\t// NewOutStream returns a new OutStream object from a Writer\n\t// Deprecated: Use github.com/docker/cli/cli/streams.NewOut instead\n\tNewOutStream = streams.NewOut\n)\n```\n\n## Functions\n\n```go\nfunc AddPlatformFlag(flags *pflag.FlagSet, target *string)\n```\nAddPlatformFlag adds \\`platform\\` to a set of flags for API version 1.32 and later.\n\n```go\nfunc AddTrustSigningFlags(fs *pflag.FlagSet, v *bool, trusted bool)\n```\nAddTrustSigningFlags adds \"signing\" flags to the provided flagset\n\n```go\nfunc AddTrustVerificationFlags(fs *pflag.FlagSet, v *bool, trusted bool)\n```\nAddTrustVerificationFlags adds content trust flags to the provided flagset\n\n```go\nfunc BuildKitEnabled(si ServerInfo) (bool, error)\n```\nBuildKitEnabled returns whether buildkit is enabled either through a daemon setting or otherwise the client-side DOCKER\\_BUILDKIT environment variable\n\n```go\nfunc ConfigureAuth(cli Cli, flUser, flPassword string, authconfig *types.AuthConfig, isDefaultRegistry bool) error\n```\nConfigureAuth handles prompting of user's username and password if needed\n\n```go\nfunc CopyToFile(outfile string, r io.Reader) error\n```\nCopyToFile writes the content of the reader to the specified file\n\n```go\nfunc ElectAuthServer(ctx context.Context, cli Cli) string\n```\nElectAuthServer returns the default registry to use (by asking the daemon)\n\n```go\nfunc EncodeAuthToBase64(authConfig types.AuthConfig) (string, error)\n```\nEncodeAuthToBase64 serializes the auth configuration as JSON base64 payload\n\n```go\nfunc GetDefaultAuthConfig(cli Cli, checkCredStore bool, serverAddress string, isDefaultRegistry bool) (*types.AuthConfig, error)\n```\nGetDefaultAuthConfig gets the default auth config given a serverAddress If credentials for given serverAddress exists in the credential store, the configuration will be populated with values in it\n\n```go\nfunc NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.ConfigFile) (client.APIClient, error)\n```\nNewAPIClientFromFlags creates a new APIClient from command line flags\n\n```go\nfunc PrettyPrint(i interface{}) string\n```\nPrettyPrint outputs arbitrary data for human formatted output by uppercasing the first letter.\n\n```go\nfunc PromptForConfirmation(ins io.Reader, outs io.Writer, message string) bool\n```\nPromptForConfirmation requests and checks confirmation from user. This will display the provided message followed by ' [y/N](/y/N) '. If the user input 'y' or 'Y' it returns true other false.  If no message is provided \"Are you sure you want to proceed? [y/N](/y/N) \" will be used instead.\n\n```go\nfunc PruneFilters(dockerCli Cli, pruneFilters filters.Args) filters.Args\n```\nPruneFilters returns consolidated prune filters obtained from config.json and cli\n\n```go\nfunc RegistryAuthenticationPrivilegedFunc(cli Cli, index *registrytypes.IndexInfo, cmdName string) types.RequestPrivilegeFunc\n```\nRegistryAuthenticationPrivilegedFunc returns a RequestPrivilegeFunc from the specified registry index info for the given command.\n\n```go\nfunc ResolveAuthConfig(ctx context.Context, cli Cli, index *registrytypes.IndexInfo) types.AuthConfig\n```\nResolveAuthConfig is like registry.ResolveAuthConfig, but if using the default index, it uses the default index name for the daemon's platform, not the client's platform.\n\n```go\nfunc RetrieveAuthTokenFromImage(ctx context.Context, cli Cli, image string) (string, error)\n```\nRetrieveAuthTokenFromImage retrieves an encoded auth token given a complete image\n\n```go\nfunc ShowHelp(err io.Writer) func(*cobra.Command, []string) error\n```\nShowHelp shows the command help.\n\n```go\nfunc UserAgent() string\n```\nUserAgent returns the user agent string used for making API requests\n\n## Types\n\n```go\ntype Cli interface {\n\tClient() client.APIClient\n\tOut() *streams.Out\n\tErr() io.Writer\n\tIn() *streams.In\n\tSetIn(in *streams.In)\n\tApply(ops ...DockerCliOption) error\n\tConfigFile() *configfile.ConfigFile\n\tServerInfo() ServerInfo\n\tClientInfo() ClientInfo\n\tNotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error)\n\tDefaultVersion() string\n\tManifestStore() manifeststore.Store\n\tRegistryClient(bool) registryclient.RegistryClient\n\tContentTrustEnabled() bool\n\tNewContainerizedEngineClient(sockPath string) (clitypes.ContainerizedClient, error)\n\tContextStore() store.Store\n\tCurrentContext() string\n\tStackOrchestrator(flagValue string) (Orchestrator, error)\n\tDockerEndpoint() docker.Endpoint\n}\n```\nCli represents the docker command line client.\n\n```go\ntype ClientInfo struct {\n\tHasExperimental bool\n\tDefaultVersion  string\n}\n```\nClientInfo stores details about the supported features of the client\n\n```go\ntype DockerCli struct {\n\t// contains filtered or unexported fields\n}\n```\nDockerCli is an instance the docker command line client. Instances of the client can be returned from NewDockerCli.\n\n```go\nfunc NewDockerCli(ops ...DockerCliOption) (*DockerCli, error)\n```\nNewDockerCli returns a DockerCli instance with all operators applied on it. It applies by default the standard streams, the content trust from environment and the default containerized client constructor operations.\n\n```go\nfunc (cli *DockerCli) Apply(ops ...DockerCliOption) error\n```\nApply all the operation on the cli\n\n```go\nfunc (cli *DockerCli) Client() client.APIClient\n```\nClient returns the APIClient\n\n```go\nfunc (cli *DockerCli) ClientInfo() ClientInfo\n```\nClientInfo returns the client details for the cli\n\n```go\nfunc (cli *DockerCli) ConfigFile() *configfile.ConfigFile\n```\nConfigFile returns the ConfigFile\n\n```go\nfunc (cli *DockerCli) ContentTrustEnabled() bool\n```\nContentTrustEnabled returns whether content trust has been enabled by an environment variable.\n\n```go\nfunc (cli *DockerCli) ContextStore() store.Store\n```\nContextStore returns the ContextStore\n\n```go\nfunc (cli *DockerCli) CurrentContext() string\n```\nCurrentContext returns the current context name\n\n```go\nfunc (cli *DockerCli) DefaultVersion() string\n```\nDefaultVersion returns api.defaultVersion or DOCKER\\_API\\_VERSION if specified.\n\n```go\nfunc (cli *DockerCli) DockerEndpoint() docker.Endpoint\n```\nDockerEndpoint returns the current docker endpoint\n\n```go\nfunc (cli *DockerCli) Err() io.Writer\n```\nErr returns the writer used for stderr\n\n```go\nfunc (cli *DockerCli) In() *streams.In\n```\nIn returns the reader used for stdin\n\n```go\nfunc (cli *DockerCli) Initialize(opts *cliflags.ClientOptions) error\n```\nInitialize the dockerCli runs initialization that must happen after command line flags are parsed.\n\n```go\nfunc (cli *DockerCli) ManifestStore() manifeststore.Store\n```\nManifestStore returns a store for local manifests\n\n```go\nfunc (cli *DockerCli) NewContainerizedEngineClient(sockPath string) (clitypes.ContainerizedClient, error)\n```\nNewContainerizedEngineClient returns a containerized engine client\n\n```go\nfunc (cli *DockerCli) NotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error)\n```\nNotaryClient provides a Notary Repository to interact with signed metadata for an image\n\n```go\nfunc (cli *DockerCli) Out() *streams.Out\n```\nOut returns the writer used for stdout\n\n```go\nfunc (cli *DockerCli) RegistryClient(allowInsecure bool) registryclient.RegistryClient\n```\nRegistryClient returns a client for communicating with a Docker distribution registry\n\n```go\nfunc (cli *DockerCli) ServerInfo() ServerInfo\n```\nServerInfo returns the server version details for the host this client is connected to\n\n```go\nfunc (cli *DockerCli) SetIn(in *streams.In)\n```\nSetIn sets the reader used for stdin\n\n```go\nfunc (cli *DockerCli) StackOrchestrator(flagValue string) (Orchestrator, error)\n```\nStackOrchestrator resolves which stack orchestrator is in use\n\n```go\ntype DockerCliOption func(cli *DockerCli) error\n```\nDockerCliOption applies a modification on a DockerCli.\n\n```go\nfunc WithCombinedStreams(combined io.Writer) DockerCliOption\n```\nWithCombinedStreams uses the same stream for the output and error streams.\n\n```go\nfunc WithContainerizedClient(containerizedFn func(string) (clitypes.ContainerizedClient, error)) DockerCliOption\n```\nWithContainerizedClient sets the containerized client constructor on a cli.\n\n```go\nfunc WithContentTrust(enabled bool) DockerCliOption\n```\nWithContentTrust enables content trust on a cli.\n\n```go\nfunc WithContentTrustFromEnv() DockerCliOption\n```\nWithContentTrustFromEnv enables content trust on a cli from environment variable DOCKER\\_CONTENT\\_TRUST value.\n\n```go\nfunc WithContextEndpointType(endpointName string, endpointType store.TypeGetter) DockerCliOption\n```\nWithContextEndpointType add support for an additional typed endpoint in the context store Plugins should use this to store additional endpoints configuration in the context store\n\n```go\nfunc WithErrorStream(err io.Writer) DockerCliOption\n```\nWithErrorStream sets a cli error stream.\n\n```go\nfunc WithInputStream(in io.ReadCloser) DockerCliOption\n```\nWithInputStream sets a cli input stream.\n\n```go\nfunc WithOutputStream(out io.Writer) DockerCliOption\n```\nWithOutputStream sets a cli output stream.\n\n```go\nfunc WithStandardStreams() DockerCliOption\n```\nWithStandardStreams sets a cli in, out and err streams with the standard streams.\n\n```go\ntype DockerContext struct {\n\tDescription       string       `json:\",omitempty\"`\n\tStackOrchestrator Orchestrator `json:\",omitempty\"`\n}\n```\nDockerContext is a typed representation of what we put in Context metadata\n\n```go\nfunc GetDockerContext(storeMetadata store.ContextMetadata) (DockerContext, error)\n```\nGetDockerContext extracts metadata from stored context metadata\n\n```go\ntype EventHandler interface {\n\tHandle(action string, h func(eventtypes.Message))\n\tWatch(c \u003c-chan eventtypes.Message)\n}\n```\nEventHandler is abstract interface for user to customize own handle functions of each type of events\n\n```go\nfunc InitEventHandler() EventHandler\n```\nInitEventHandler initializes and returns an EventHandler\n\n```go\ntype InStream = streams.In\n```\nInStream is an input stream used by the DockerCli to read user input Deprecated: Use github.com/docker/cli/cli/streams.In instead\n\n```go\ntype Orchestrator string\n```\nOrchestrator type acts as an enum describing supported orchestrators.\n\n```go\nfunc GetStackOrchestrator(flagValue, contextValue, globalDefault string, stderr io.Writer) (Orchestrator, error)\n```\nGetStackOrchestrator checks DOCKER\\_STACK\\_ORCHESTRATOR environment variable and configuration file orchestrator value and returns user defined Orchestrator.\n\n```go\nfunc NormalizeOrchestrator(value string) (Orchestrator, error)\n```\nNormalizeOrchestrator parses an orchestrator value and checks if it is valid\n\n```go\nfunc (o Orchestrator) HasAll() bool\n```\nHasAll returns true if defined orchestrator has both Swarm and Kubernetes capabilities.\n\n```go\nfunc (o Orchestrator) HasKubernetes() bool\n```\nHasKubernetes returns true if defined orchestrator has Kubernetes capabilities.\n\n```go\nfunc (o Orchestrator) HasSwarm() bool\n```\nHasSwarm returns true if defined orchestrator has Swarm capabilities.\n\n```go\ntype OutStream = streams.Out\n```\nOutStream is an output stream used by the DockerCli to write normal program output. Deprecated: Use github.com/docker/cli/cli/streams.Out instead\n\n```go\ntype ServerInfo struct {\n\tHasExperimental bool\n\tOSType          string\n\tBuildkitVersion types.BuilderVersion\n}\n```\nServerInfo stores details about the supported features and platform of the server\n\n```go\ntype Streams interface {\n\tIn() *streams.In\n\tOut() *streams.Out\n\tErr() io.Writer\n}\n```\nStreams is an interface which exposes the standard input and output streams\n\n","path":"github.com/rancher/docker-cli/cli/command","name":"command","synopsis":"","isRedistributable":true}
