command

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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

func (i *InStream) CheckTty(attachStdin, ttyMode bool) error

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) Close

func (i *InStream) Close() error

Close implements the Closer interface

func (*InStream) FD

func (i *InStream) FD() uintptr

FD returns the file descriptor number for this stream

func (*InStream) IsTerminal

func (i *InStream) IsTerminal() bool

IsTerminal returns true if this stream is connected to a terminal

func (*InStream) Read

func (i *InStream) Read(p []byte) (int, error)

func (*InStream) RestoreTerminal

func (i *InStream) RestoreTerminal()

RestoreTerminal restores normal mode to the terminal

func (*InStream) SetRawTerminal

func (i *InStream) SetRawTerminal() (err error)

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

func NewOutStream(out io.Writer) *OutStream

NewOutStream returns a new OutStream object from a Writer

func (*OutStream) FD

func (o *OutStream) FD() uintptr

FD returns the file descriptor number for this stream

func (*OutStream) GetTtySize

func (o *OutStream) GetTtySize() (uint, uint)

GetTtySize returns the height and width in characters of the tty

func (*OutStream) IsTerminal

func (o *OutStream) IsTerminal() bool

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

func (o *OutStream) SetRawTerminal() (err error)

SetRawTerminal sets raw mode on the output terminal

func (*OutStream) Write

func (o *OutStream) Write(p []byte) (int, error)

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

func (*StorageOSCli) ShowHelp

func (cli *StorageOSCli) ShowHelp(cmd *cobra.Command, args []string) error

ShowHelp shows the command help.

type Streams

type Streams interface {
	In() *InStream
	Out() *OutStream
	Err() io.Writer
}

Streams is an interface which exposes the standard input and output streams

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL