streams

package
v0.1.0-M4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0, EPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachConfig

type AttachConfig struct {
	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

type Stream interface {
	Stdin() io.ReadCloser
	StdinPipe() io.WriteCloser
	NewStdinInput()
	NewDiscardStdinInput()
	Stdout() io.WriteCloser
	AddStdoutWriter(w io.WriteCloser)
	AddStderrWriter(w io.WriteCloser)
	Stderr() io.WriteCloser
	NewStdoutPipe() io.ReadCloser
	NewStderrPipe() io.ReadCloser
	Attach(ctx context.Context, cfg *AttachConfig) <-chan error
	CopyPipes(p Pipes)
	Close() error
	// sync.WaitGroup interface
	Wait()
}

Stream for containers IOs handling

func NewStream

func NewStream() Stream

NewStream returns new streams.

Jump to

Keyboard shortcuts

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