stream

package
v1.4.2-0...-6138a02 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

Config holds information about I/O streams managed together.

config.StdinPipe returns a WriteCloser which can be used to feed data to the standard input of the streamConfig's active process. config.StdoutPipe and streamConfig.StderrPipe each return a ReadCloser which can be used to retrieve the standard output (and error) generated by the container's active process. The output (and error) are actually copied and delivered to all StdoutPipe and StderrPipe consumers, using a kind of "broadcaster".

func NewConfig

func NewConfig() *Config

NewConfig creates a stream config and initializes the standard err and standard out to new unbuffered broadcasters.

func (*Config) CloseStreams

func (c *Config) CloseStreams() error

CloseStreams ensures that the configured streams are properly closed.

func (*Config) CopyToPipe

func (c *Config) CopyToPipe(iop libcontainerd.IOPipe)

CopyToPipe connects streamconfig with a libcontainerd.IOPipe

func (*Config) NewInputPipes

func (c *Config) NewInputPipes()

NewInputPipes creates new pipes for both standard inputs, Stdin and StdinPipe.

func (*Config) NewNopInputPipe

func (c *Config) NewNopInputPipe()

NewNopInputPipe creates a new input pipe that will silently drop all messages in the input.

func (*Config) Stderr

func (c *Config) Stderr() *broadcaster.Unbuffered

Stderr returns the standard error in the configuration.

func (*Config) StderrPipe

func (c *Config) StderrPipe() io.ReadCloser

StderrPipe creates a new io.ReadCloser with an empty bytes pipe. It adds this new err pipe to the Stderr broadcaster.

func (*Config) Stdin

func (c *Config) Stdin() io.ReadCloser

Stdin returns the standard input in the configuration.

func (*Config) StdinPipe

func (c *Config) StdinPipe() io.WriteCloser

StdinPipe returns an input writer pipe as an io.WriteCloser.

func (*Config) Stdout

func (c *Config) Stdout() *broadcaster.Unbuffered

Stdout returns the standard output in the configuration.

func (*Config) StdoutPipe

func (c *Config) StdoutPipe() io.ReadCloser

StdoutPipe creates a new io.ReadCloser with an empty bytes pipe. It adds this new out pipe to the Stdout broadcaster.

Jump to

Keyboard shortcuts

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