Documentation ¶
Index ¶
- func LoadDefaultConfigFile(err io.Writer) *configfile.ConfigFile
- func NewAPIClientFromFlags(opt *cliflags.CommonOptions) (*api.Client, error)
- type Cli
- type InStream
- type OutStream
- type StorageOSCli
- func (cli *StorageOSCli) Client() *api.Client
- func (cli *StorageOSCli) ConfigFile() *configfile.ConfigFile
- func (cli *StorageOSCli) DefaultVersion() string
- func (cli *StorageOSCli) Err() io.Writer
- func (cli *StorageOSCli) HasExperimental() bool
- func (cli *StorageOSCli) In() *InStream
- func (cli *StorageOSCli) Initialize(opt *cliflags.ClientOptions) error
- func (cli *StorageOSCli) Out() *OutStream
- func (cli *StorageOSCli) ShowHelp(cmd *cobra.Command, args []string) error
- type Streams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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(opt *cliflags.CommonOptions) (*api.Client, error)
NewAPIClientFromFlags creates a new APIClient from command line flags func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.ConfigFile) (client.APIClient, error) {
Types ¶
type Cli ¶
type Cli interface { Client() api.Client Out() *OutStream Err() io.Writer In() *InStream ConfigFile() *configfile.ConfigFile }
Cli represents the storageos command line client.
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 StorageOSCli ¶
type StorageOSCli struct {
// contains filtered or unexported fields
}
StorageOSCli is an instance the storageos command line client. Instances of the client can be returned from NewStorageOSCli.
func NewStorageOSCli ¶
func NewStorageOSCli(in io.ReadCloser, out, err io.Writer) *StorageOSCli
NewStorageOSCli returns a StorageOSCli instance with IO output and error streams set by in, out and err.
func (*StorageOSCli) Client ¶
func (cli *StorageOSCli) Client() *api.Client
Client returns the APIClient
func (*StorageOSCli) ConfigFile ¶
func (cli *StorageOSCli) ConfigFile() *configfile.ConfigFile
ConfigFile returns the ConfigFile
func (*StorageOSCli) DefaultVersion ¶
func (cli *StorageOSCli) DefaultVersion() string
DefaultVersion returns api.defaultVersion of DOCKER_API_VERSION if specified.
func (*StorageOSCli) Err ¶
func (cli *StorageOSCli) Err() io.Writer
Err returns the writer used for stderr
func (*StorageOSCli) HasExperimental ¶
func (cli *StorageOSCli) HasExperimental() bool
HasExperimental returns true if experimental features are accessible.
func (*StorageOSCli) In ¶
func (cli *StorageOSCli) In() *InStream
In returns the reader used for stdin
func (*StorageOSCli) Initialize ¶
func (cli *StorageOSCli) Initialize(opt *cliflags.ClientOptions) error
Initialize the dockerCli runs initialization that must happen after command line flags are parsed.
func (*StorageOSCli) Out ¶
func (cli *StorageOSCli) Out() *OutStream
Out returns the writer used for stdout