client

package
v0.0.0-...-3cebe5e Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachVMOptions

type AttachVMOptions struct {
	NumIOStreams int
}

AttachVMOptions holds extra arguments one can pass to the AttachVM function.

See the api.AttachVM payload for more details.

type AttachVMReturn

type AttachVMReturn api.AttachVMResponse

AttachVMReturn contains the return values from AttachVM.

See the api.AttachVM and api.AttachVMResponse payloads.

type Client

type Client struct {
	// contains filtered or unexported fields
}

The Client struct can be used to issue proxy API calls with a convenient high level API.

func NewClient

func NewClient(conn net.Conn) *Client

NewClient creates a new client object to communicate with the proxy using the connection conn. The user should call Close() once finished with the client object to close conn.

func (*Client) AttachVM

func (client *Client) AttachVM(containerID string, options *AttachVMOptions) (*AttachVMReturn, error)

AttachVM wraps the api.AttachVM payload.

See the api.AttachVM payload description for more details.

func (*Client) Close

func (client *Client) Close()

Close a client, closing the underlying AF_UNIX socket.

func (*Client) ConnectShim

func (client *Client) ConnectShim(token string) error

ConnectShim wraps the api.CmdConnectShim command and associated api.ConnectShim payload.

func (*Client) DisconnectShim

func (client *Client) DisconnectShim() error

DisconnectShim wraps the api.CmdDisconnectShim command and associated api.DisconnectShim payload.

func (*Client) Hyper

func (client *Client) Hyper(hyperName string, hyperMessage interface{}) ([]byte, error)

Hyper wraps the Hyper payload (see payload description for more details)

func (*Client) HyperWithTokens

func (client *Client) HyperWithTokens(hyperName string, tokens []string, hyperMessage interface{}) ([]byte, error)

HyperWithTokens is a Hyper variant where the users can specify a list of I/O tokens.

See the api.Hyper payload description for more details.

func (*Client) Kill

func (client *Client) Kill(signal syscall.Signal) error

Kill wraps the api.CmdSignal command and can be used by a shim to send a signal to the associated process.

func (*Client) Log

func (client *Client) Log(level LogLevel, source LogSource, containerID string, args ...interface{})

Log sends log entries.

func (*Client) Logf

func (client *Client) Logf(level LogLevel, source LogSource, containerID string, format string, args ...interface{})

Logf sends log entries.

func (*Client) RegisterVM

func (client *Client) RegisterVM(containerID, ctlSerial, ioSerial string,
	options *RegisterVMOptions) (*RegisterVMReturn, error)

RegisterVM wraps the api.RegisterVM payload.

See payload description for more details.

func (*Client) SendStdin

func (client *Client) SendStdin(data []byte) error

SendStdin sends stdin data. This can only be used from shim clients.

func (*Client) SendTerminalSize

func (client *Client) SendTerminalSize(columns, rows int) error

SendTerminalSize wraps the api.CmdSignal command and can be used by a shim to send a new signal to the associated process.

func (*Client) UnregisterVM

func (client *Client) UnregisterVM(containerID string) error

UnregisterVM wraps the api.UnregisterVM payload.

See the api.UnregisterVM payload description for more details.

type LogLevel

type LogLevel uint8

LogLevel is the severity of log entries.

const (
	// LogLevelDebug is for log messages only useful debugging.
	LogLevelDebug LogLevel = iota
	// LogLevelInfo is for reporting landmark events.
	LogLevelInfo
	// LogLevelWarn is for reporting warnings.
	LogLevelWarn
	// LogLevelError is for reporting errors.
	LogLevelError
)

func (LogLevel) String

func (l LogLevel) String() string

String implements stringer for LogLevel.

type LogSource

type LogSource uint8

LogSource is the source of log entries

const (
	// LogSourceRuntime represents a runtime.
	LogSourceRuntime LogSource = iota
	// LogSourceShim represents a shim.
	LogSourceShim
)

func (LogSource) String

func (s LogSource) String() string

String implements stringer for LogSource

type RegisterVMOptions

type RegisterVMOptions struct {
	Console      string
	NumIOStreams int
}

RegisterVMOptions holds extra arguments one can pass to the RegisterVM function.

See the api.RegisterVM payload for more details.

type RegisterVMReturn

type RegisterVMReturn api.RegisterVMResponse

RegisterVMReturn contains the return values from RegisterVM.

See the api.RegisterVM and api.RegisterVMResponse payloads.

Jump to

Keyboard shortcuts

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