Documentation ¶
Index ¶
- type AttachConfig
- type Pipes
- type Stream
- func (s *Stream) AddStderrWriter(w io.WriteCloser)
- func (s *Stream) AddStdoutWriter(w io.WriteCloser)
- func (s *Stream) Attach(ctx context.Context, cfg *AttachConfig) <-chan error
- func (s *Stream) Close() error
- func (s *Stream) CopyPipes(p Pipes)
- func (s *Stream) NewDiscardStdinInput()
- func (s *Stream) NewStderrPipe() io.ReadCloser
- func (s *Stream) NewStdinInput()
- func (s *Stream) NewStdoutPipe() io.ReadCloser
- func (s *Stream) Stderr() io.WriteCloser
- func (s *Stream) Stdin() io.ReadCloser
- func (s *Stream) StdinPipe() io.WriteCloser
- func (s *Stream) Stdout() io.WriteCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttachConfig ¶
type AttachConfig struct { Detach bool Terminal bool // CloseStdin means if the stdin of client's stream is closed by the // caller, the stdin of process's stream should be closed. CloseStdin bool // UseStdin/UseStdout/UseStderr can be used to check the client's stream // is nil or not. It is hard to check io.Write/io.ReadCloser != nil // directly, because they might be specific type, which means // (typ != nil) always is true. UseStdin, UseStdout, UseStderr bool Stdin io.ReadCloser Stdout, Stderr io.Writer }
AttachConfig is used to describe how to attach the client's stream to the process's stream.
type Pipes ¶
type Pipes struct { Stdin io.WriteCloser Stdout io.ReadCloser Stderr io.ReadCloser }
Pipes is used to present any downstream pipe, for example, containerd's cio.
type Stream ¶
Stream is used to handle container IO.
func (*Stream) AddStderrWriter ¶
func (s *Stream) AddStderrWriter(w io.WriteCloser)
AddStderrWriter adds the stderr writer.
func (*Stream) AddStdoutWriter ¶
func (s *Stream) AddStdoutWriter(w io.WriteCloser)
AddStdoutWriter adds the stdout writer.
func (*Stream) Attach ¶
func (s *Stream) Attach(ctx context.Context, cfg *AttachConfig) <-chan error
Attach will use stream defined by AttachConfig to attach the Stream.
func (*Stream) CopyPipes ¶
CopyPipes will watchs the data pipe's channel, like sticked to the pipe.
NOTE: don't assign the specific type to the Pipes because the Std* != nil always return true.
func (*Stream) NewDiscardStdinInput ¶
func (s *Stream) NewDiscardStdinInput()
NewDiscardStdinInput creates a no-op WriteCloser for StdinPipe().
func (*Stream) NewStderrPipe ¶
func (s *Stream) NewStderrPipe() io.ReadCloser
NewStderrPipe creates pipe and register it into Stderr.
func (*Stream) NewStdinInput ¶
func (s *Stream) NewStdinInput()
NewStdinInput creates pipe for Stdin() and StdinPipe().
func (*Stream) NewStdoutPipe ¶
func (s *Stream) NewStdoutPipe() io.ReadCloser
NewStdoutPipe creates pipe and register it into Stdout.
func (*Stream) Stderr ¶
func (s *Stream) Stderr() io.WriteCloser
Stderr returns the Stderr for writer.
func (*Stream) StdinPipe ¶
func (s *Stream) StdinPipe() io.WriteCloser
StdinPipe returns the Stdin for writer.
func (*Stream) Stdout ¶
func (s *Stream) Stdout() io.WriteCloser
Stdout returns the Stdout for writer.