package agents
import "github.com/containerd/cri/pkg/server/io"
Index ¶
- func NewCRILogger(path string, stream StreamType) (io.WriteCloser, error)
- func NewDiscardLogger() io.WriteCloser
- type ContainerIO
- func NewContainerIO(id string, opts ...Opts) (*ContainerIO, error)
- func (c *ContainerIO) Attach(stdin io.Reader, stdout, stderr io.WriteCloser) error
- func (c *ContainerIO) Cancel()
- func (c *ContainerIO) Close() error
- func (c *ContainerIO) Config() containerd.IOConfig
- func (c *ContainerIO) Pipe() (err error)
- func (c *ContainerIO) Wait()
- type Opts
- func WithFIFOs(dir, stdin, stdout, stderr string) Opts
- func WithOutput(name string, stdout, stderr io.WriteCloser) Opts
- func WithRootDir(root string) Opts
- func WithStdin(stdin bool) Opts
- func WithTerminal(tty bool) Opts
- type StreamType
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 ¶
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 ¶
WithRootDir sets the root directory to create container streams.
func WithStdin ¶
WithStdin enables stdin of the container io.
func WithTerminal ¶
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" )
Source Files ¶
- Version
- v1.0.0-alpha.1
- Published
- Oct 31, 2017
- Platform
- js/wasm
- Imports
- 18 packages
- Last checked
- 4 hours ago –
Tools for package owners.