...

Package flags

import "github.com/docker/cli/cli/flags"
Overview
Index

Overview ▾

Constants

const (
    // EnvEnableTLS is the name of the environment variable that can be used
    // to enable TLS for client connections. When set to a non-empty value, TLS
    // is enabled for API connections using TCP. For backward-compatibility, this
    // environment-variable can only be used to enable TLS, not to disable.
    //
    // Note that TLS is always enabled implicitly if the "--tls-verify" option
    // or "DOCKER_TLS_VERIFY" ([github.com/docker/docker/client.EnvTLSVerify])
    // env var is set to, which could be to either enable or disable TLS certification
    // validation. In both cases, TLS is enabled but, depending on the setting,
    // with verification disabled.
    EnvEnableTLS = "DOCKER_TLS"

    // DefaultCaFile is the default filename for the CA pem file
    DefaultCaFile = "ca.pem"
    // DefaultKeyFile is the default filename for the key pem file
    DefaultKeyFile = "key.pem"
    // DefaultCertFile is the default filename for the cert pem file
    DefaultCertFile = "cert.pem"
    // FlagTLSVerify is the flag name for the TLS verification option
    FlagTLSVerify = "tlsverify"
    // FormatHelp describes the --format flag behavior for list commands
    FormatHelp = `Format output using a custom template:
'table':            Print output in table format with column headers (default)
'table TEMPLATE':   Print output in table format using the given Go template
'json':             Print in JSON format
'TEMPLATE':         Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates`
    // InspectFormatHelp describes the --format flag behavior for inspect commands
    InspectFormatHelp = `Format output using a custom template:
'json':             Print in JSON format
'TEMPLATE':         Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates`
)

func SetLogLevel

func SetLogLevel(logLevel string)

SetLogLevel sets the logrus logging level

type ClientOptions

ClientOptions are the options used to configure the client cli.

type ClientOptions struct {
    Debug      bool
    Hosts      []string
    LogLevel   string
    TLS        bool
    TLSVerify  bool
    TLSOptions *tlsconfig.Options
    Context    string
    ConfigDir  string
}

func NewClientOptions

func NewClientOptions() *ClientOptions

NewClientOptions returns a new ClientOptions.

func (*ClientOptions) InstallFlags

func (o *ClientOptions) InstallFlags(flags *pflag.FlagSet)

InstallFlags adds flags for the common options on the FlagSet

func (*ClientOptions) SetDefaultOptions

func (o *ClientOptions) SetDefaultOptions(flags *pflag.FlagSet)

SetDefaultOptions sets default values for options after flag parsing is complete