package cio
import "github.com/containerd/containerd/cio"
Index ¶
- type Attach
- type Config
- type Creation
- func NewIO(stdin io.Reader, stdout, stderr io.Writer) Creation
- func NewIOWithTerminal(stdin io.Reader, stdout, stderr io.Writer, terminal bool) Creation
- type DirectIO
- func NewDirectIO(ctx context.Context, terminal bool) (*DirectIO, error)
- func (f *DirectIO) Cancel()
- func (f *DirectIO) Close() error
- func (f *DirectIO) Config() Config
- func (f *DirectIO) Delete() error
- func (f *DirectIO) IOAttach(set *FIFOSet) (IO, error)
- func (f *DirectIO) IOCreate(id string) (IO, error)
- func (f *DirectIO) Wait()
- type FIFOSet
- type IO
Types ¶
type Attach ¶
Attach allows callers to reattach to running tasks
There should only be one reader for a task's IO set because fifo's can only be read from one reader or the output will be sent only to the first reads
func WithAttach ¶
WithAttach attaches the existing io for a task to the provided io.Reader/Writers
type Config ¶
type Config struct { // Terminal is true if one has been allocated Terminal bool // Stdin path Stdin string // Stdout path Stdout string // Stderr path Stderr string }
Config holds the io configurations.
type Creation ¶
Creation creates new IO sets for a task
func NewIO ¶
NewIO returns an Creation that will provide IO sets without a terminal
func NewIOWithTerminal ¶
NewIOWithTerminal creates a new io set with the provied io.Reader/Writers for use with a terminal
type DirectIO ¶
type DirectIO struct { Stdin io.WriteCloser Stdout io.ReadCloser Stderr io.ReadCloser // contains filtered or unexported fields }
DirectIO allows task IO to be handled externally by the caller
func NewDirectIO ¶
NewDirectIO returns an IO implementation that exposes the pipes directly
func (*DirectIO) Cancel ¶
func (f *DirectIO) Cancel()
Cancel stops any IO copy operations
Not applicable for DirectIO
func (*DirectIO) Close ¶
Close closes all open fds
func (*DirectIO) Config ¶
Config returns the Config
func (*DirectIO) Delete ¶
Delete removes the underlying directory containing fifos
func (*DirectIO) IOAttach ¶
IOAttach returns IO avaliable for use with task attachment
func (*DirectIO) IOCreate ¶
IOCreate returns IO avaliable for use with task creation
func (*DirectIO) Wait ¶
func (f *DirectIO) Wait()
Wait on any IO copy operations
Not applicable for DirectIO
type FIFOSet ¶
type FIFOSet struct { // Dir is the directory holding the task fifos Dir string // In, Out, and Err fifo paths In, Out, Err string // Terminal returns true if a terminal is being used for the task Terminal bool }
FIFOSet is a set of fifos for use with tasks
func NewFifos ¶
NewFifos returns a new set of fifos for the task
type IO ¶
type IO interface { // Config returns the IO configuration. Config() Config // Cancel aborts all current io operations Cancel() // Wait blocks until all io copy operations have completed Wait() // Close cleans up all open io resources Close() error }
IO holds the io information for a task or process
func NullIO ¶
NullIO redirects the container's IO into /dev/null
func Stdio ¶
Stdio returns an IO set to be used for a task that outputs the container's IO as the current processes Stdio
func StdioTerminal ¶
StdioTerminal will setup the IO for the task to use a terminal
Source Files ¶
- Version
- v1.0.1
- Published
- Jan 17, 2018
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 1 minute ago –
Tools for package owners.