stdio

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsole

func NewConsole() (*os.File, string, error)

NewConsole allocates a new console and returns the File for its master and path for its slave.

func ResizeConsole

func ResizeConsole(pty *os.File, height, width uint16) error

ResizeConsole sends the appropriate resize to a pTTY FD Synchronization of pty should be handled in the callers context.

Types

type ConnectionSet

type ConnectionSet struct {
	In, Out, Err transport.Connection
}

ConnectionSet is a structure defining the readers and writers the Core implementation should forward a process's stdio through.

func (*ConnectionSet) Close

func (s *ConnectionSet) Close() error

Close closes each stdio connection.

func (*ConnectionSet) Files

func (s *ConnectionSet) Files() (_ *FileSet, err error)

Files returns a FileSet with an os.File for each connection in the connection set.

func (*ConnectionSet) NewPipeRelay added in v0.3.3

func (s *ConnectionSet) NewPipeRelay() (_ *PipeRelay, err error)

NewPipeRelay returns a new pipe relay wrapping the given connection stdin, stdout, stderr set.

func (*ConnectionSet) NewTtyRelay

func (s *ConnectionSet) NewTtyRelay(pty *os.File) *TtyRelay

NewTtyRelay returns a new TTY relay for a given master PTY file.

type FileSet

type FileSet struct {
	In, Out, Err *os.File
}

FileSet contains os.File fields for stdio.

func (*FileSet) Close

func (fs *FileSet) Close() error

Close closes all the FileSet handles.

type PipeRelay added in v0.3.3

type PipeRelay struct {
	// contains filtered or unexported fields
}

PipeRelay is a relay built to expose a pipe interface for stdin, stdout, stderr on top of a ConnectionSet.

func (*PipeRelay) Files added in v0.3.3

func (pr *PipeRelay) Files() (*FileSet, error)

Files returns a FileSet with an os.File for each connection in the connection set.

func (*PipeRelay) Start added in v0.3.3

func (pr *PipeRelay) Start()

Start starts the relay operation. The caller must call Wait to wait for the relay to finish and release the associated resources.

func (*PipeRelay) Wait added in v0.3.3

func (pr *PipeRelay) Wait()

Wait waits for the relaying to finish and closes the associated pipes and connections.

type TtyRelay

type TtyRelay struct {
	// contains filtered or unexported fields
}

TtyRelay relays IO between a set of stdio connections and a master PTY file.

func (*TtyRelay) ResizeConsole

func (r *TtyRelay) ResizeConsole(height, width uint16) error

ResizeConsole sends the appropriate resize to a pTTY FD

func (*TtyRelay) Start

func (r *TtyRelay) Start()

Start starts the relay operation. The caller must call Wait to wait for the relay to finish and release the associated resources.

func (*TtyRelay) Wait

func (r *TtyRelay) Wait()

Wait waits for the relaying to finish and closes the associated files and connections.

Jump to

Keyboard shortcuts

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