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) 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.
type Opts ¶
type Opts func(*ContainerIO) error
Opts sets specific information to newly created ContainerIO.
func WithOutput ¶
func WithOutput(name string, stdout, stderr io.WriteCloser) Opts
WithOutput adds output stream to the container io.
func WithRootDir ¶
WithRootDir sets the root directory to create container streams.
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" )
Click to show internal directories.
Click to hide internal directories.