Documentation
¶
Index ¶
- func ConfigureAuth(cli *DockerCli, flUser, flPassword, serverAddress string, ...) (types.AuthConfig, error)
- func ElectAuthServer(ctx context.Context, cli *DockerCli) string
- func EncodeAuthToBase64(authConfig types.AuthConfig) (string, error)
- func LoadDefaultConfigFile(err io.Writer) *configfile.ConfigFile
- func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.ConfigFile) (client.APIClient, error)
- func RegistryAuthenticationPrivilegedFunc(cli *DockerCli, index *registrytypes.IndexInfo, cmdName string) types.RequestPrivilegeFunc
- func ResolveAuthConfig(ctx context.Context, cli *DockerCli, index *registrytypes.IndexInfo) types.AuthConfig
- func RetrieveAuthTokenFromImage(ctx context.Context, cli *DockerCli, image string) (string, error)
- func UserAgent() string
- type Cli
- type DockerCli
- func (cli *DockerCli) Client() client.APIClient
- func (cli *DockerCli) ConfigFile() *configfile.ConfigFile
- func (cli *DockerCli) CredentialsStore(serverAddress string) credentials.Store
- func (cli *DockerCli) DefaultVersion() string
- func (cli *DockerCli) Err() io.Writer
- func (cli *DockerCli) GetAllCredentials() (map[string]types.AuthConfig, error)
- func (cli *DockerCli) In() *InStream
- func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions) error
- func (cli *DockerCli) Out() *OutStream
- func (cli *DockerCli) ServerInfo() ServerInfo
- func (cli *DockerCli) SetConfigFile(configFile *configfile.ConfigFile)
- func (cli *DockerCli) ShowHelp(cmd *cobra.Command, args []string) error
- type InStream
- type OutStream
- type ServerInfo
- type Streams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureAuth ¶
func ConfigureAuth(cli *DockerCli, flUser, flPassword, serverAddress string, isDefaultRegistry bool) (types.AuthConfig, error)
ConfigureAuth returns an AuthConfig from the specified user, password and server.
func ElectAuthServer ¶
ElectAuthServer returns the default registry to use (by asking the daemon)
func EncodeAuthToBase64 ¶
func EncodeAuthToBase64(authConfig types.AuthConfig) (string, error)
EncodeAuthToBase64 serializes the auth configuration as JSON base64 payload
func LoadDefaultConfigFile ¶
func LoadDefaultConfigFile(err io.Writer) *configfile.ConfigFile
LoadDefaultConfigFile attempts to load the default config file and returns an initialized ConfigFile struct if none is found.
func NewAPIClientFromFlags ¶
func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.ConfigFile) (client.APIClient, error)
NewAPIClientFromFlags creates a new APIClient from command line flags
func RegistryAuthenticationPrivilegedFunc ¶
func RegistryAuthenticationPrivilegedFunc(cli *DockerCli, index *registrytypes.IndexInfo, cmdName string) types.RequestPrivilegeFunc
RegistryAuthenticationPrivilegedFunc returns a RequestPrivilegeFunc from the specified registry index info for the given command.
func ResolveAuthConfig ¶
func ResolveAuthConfig(ctx context.Context, cli *DockerCli, index *registrytypes.IndexInfo) types.AuthConfig
ResolveAuthConfig 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.
func RetrieveAuthTokenFromImage ¶
RetrieveAuthTokenFromImage retrieves an encoded auth token given a complete image
Types ¶
type Cli ¶
type Cli interface {
Client() client.APIClient
Out() *OutStream
Err() io.Writer
In() *InStream
ConfigFile() *configfile.ConfigFile
}
Cli represents the docker command line client.
type DockerCli ¶
type DockerCli struct {
// contains filtered or unexported fields
}
DockerCli is an instance the docker command line client. Instances of the client can be returned from NewDockerCli.
func NewDockerCli ¶
func NewDockerCli(in io.ReadCloser, out, err io.Writer) *DockerCli
NewDockerCli returns a DockerCli instance with IO output and error streams set by in, out and err.
func (*DockerCli) ConfigFile ¶
func (cli *DockerCli) ConfigFile() *configfile.ConfigFile
ConfigFile returns the ConfigFile
func (*DockerCli) CredentialsStore ¶
func (cli *DockerCli) CredentialsStore(serverAddress string) credentials.Store
CredentialsStore returns a new credentials store based on the settings provided in the configuration file. Empty string returns the default credential store.
func (*DockerCli) DefaultVersion ¶
DefaultVersion returns api.defaultVersion or DOCKER_API_VERSION if specified.
func (*DockerCli) GetAllCredentials ¶
func (cli *DockerCli) GetAllCredentials() (map[string]types.AuthConfig, error)
GetAllCredentials returns all of the credentials stored in all of the configured credential stores.
func (*DockerCli) Initialize ¶
func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions) error
Initialize the dockerCli runs initialization that must happen after command line flags are parsed.
func (*DockerCli) ServerInfo ¶
func (cli *DockerCli) ServerInfo() ServerInfo
ServerInfo returns the server version details for the host this client is connected to
func (*DockerCli) SetConfigFile ¶
func (cli *DockerCli) SetConfigFile(configFile *configfile.ConfigFile)
SetConfigFile sets the ConfigFile This method is specific to AMP. The original code doesn't allow configuration to be updated.
type InStream ¶
type InStream struct {
// contains filtered or unexported fields
}
InStream is an input stream used by the DockerCli to read user input
func NewInStream ¶
func NewInStream(in io.ReadCloser) *InStream
NewInStream returns a new InStream object from a ReadCloser
func (*InStream) CheckTty ¶
CheckTty checks if we are trying to attach to a container tty from a non-tty client input stream, and if so, returns an error.
func (*InStream) IsTerminal ¶
IsTerminal returns true if this stream is connected to a terminal
func (*InStream) RestoreTerminal ¶
func (i *InStream) RestoreTerminal()
RestoreTerminal restores normal mode to the terminal
func (*InStream) SetRawTerminal ¶
SetRawTerminal sets raw mode on the input terminal
type OutStream ¶
type OutStream struct {
// contains filtered or unexported fields
}
OutStream is an output stream used by the DockerCli to write normal program output.
func NewOutStream ¶
NewOutStream returns a new OutStream object from a Writer
func (*OutStream) GetTtySize ¶
GetTtySize returns the height and width in characters of the tty
func (*OutStream) IsTerminal ¶
IsTerminal returns true if this stream is connected to a terminal
func (*OutStream) RestoreTerminal ¶
func (o *OutStream) RestoreTerminal()
RestoreTerminal restores normal mode to the terminal
func (*OutStream) SetRawTerminal ¶
SetRawTerminal sets raw mode on the output terminal
type ServerInfo ¶
ServerInfo stores details about the supported features and platform of the server