agents

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2017 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCRILogger

func NewCRILogger(path string, stream StreamType) (io.WriteCloser, error)

NewCRILogger returns a write closer which redirect container log into log file, and decorate the log line into CRI defined format.

func NewDiscardLogger

func NewDiscardLogger() io.WriteCloser

NewDiscardLogger creates logger which discards all the input.

Types

type ContainerIO

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

ContainerIO holds the container io.

func NewContainerIO

func NewContainerIO(id string, opts ...Opts) (*ContainerIO, error)

NewContainerIO creates container io.

func (*ContainerIO) Attach

func (c *ContainerIO) Attach(stdin io.Reader, stdout, stderr io.WriteCloser) error

Attach attaches container stdio.

func (*ContainerIO) Cancel

func (c *ContainerIO) Cancel()

Cancel cancels container io.

func (*ContainerIO) Close

func (c *ContainerIO) Close() error

Close closes all FIFOs.

func (*ContainerIO) Config

func (c *ContainerIO) Config() containerd.IOConfig

Config returns io config.

func (*ContainerIO) Pipe

func (c *ContainerIO) Pipe() (err error)

Pipe creates container fifos and pipe container output to output stream.

func (*ContainerIO) Wait

func (c *ContainerIO) Wait()

Wait waits container io to finish.

type Opts

type Opts func(*ContainerIO) error

Opts sets specific information to newly created ContainerIO.

func WithFIFOs

func WithFIFOs(dir, stdin, stdout, stderr string) Opts

WithFIFOs specifies existing fifos for the container io.

func WithOutput

func WithOutput(name string, stdout, stderr io.WriteCloser) Opts

WithOutput adds output stream to the container io.

func WithRootDir

func WithRootDir(root string) Opts

WithRootDir sets the root directory to create container streams.

func WithStdin

func WithStdin(stdin bool) Opts

WithStdin enables stdin of the container io.

func WithTerminal

func WithTerminal(tty bool) Opts

WithTerminal enables tty of the container io.

type StreamType

type StreamType string

StreamType is the type of the stream, stdout/stderr.

const (
	// Stdin stream type.
	Stdin StreamType = "stdin"
	// Stdout stream type.
	Stdout StreamType = "stdout"
	// Stderr stream type.
	Stderr StreamType = "stderr"
)

Jump to

Keyboard shortcuts

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