stream

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonStream

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

CommonStream is an input stream used by the DockerCli to read user input

func (*CommonStream) FD

func (s *CommonStream) FD() uintptr

FD returns the file descriptor number for this stream

func (*CommonStream) IsTerminal

func (s *CommonStream) IsTerminal() bool

IsTerminal returns true if this stream is connected to a terminal

func (*CommonStream) RestoreTerminal

func (s *CommonStream) RestoreTerminal() error

RestoreTerminal restores normal mode to the terminal

func (*CommonStream) SetIsTerminal

func (s *CommonStream) SetIsTerminal(isTerminal bool)

SetIsTerminal sets the boolean used for isTerminal

type InStream

type InStream struct {
	CommonStream
	// contains filtered or unexported fields
}

InStream is an input stream used by the DockerCli to read user input

func NewInStream

func NewInStream(in io.ReadCloser) *InStream

NewInStream returns a new InStream object from a ReadCloser

func (*InStream) CheckTty

func (i *InStream) CheckTty(attachStdin, ttyMode bool) error

CheckTty checks if we are trying to attach to a container tty from a non-tty client input stream, and if so, returns an error.

func (*InStream) Close

func (i *InStream) Close() error

Close implements the Closer interface

func (*InStream) Read

func (i *InStream) Read(p []byte) (int, error)

func (*InStream) SetRawTerminal

func (i *InStream) SetRawTerminal() (err error)

SetRawTerminal sets raw mode on the input terminal

type OutStream

type OutStream struct {
	CommonStream
	// contains filtered or unexported fields
}

OutStream is an output stream used by the DockerCli to write normal program output.

func NewOutStream

func NewOutStream(out io.Writer) *OutStream

NewOutStream returns a new OutStream object from a Writer

func (*OutStream) GetTtySize

func (o *OutStream) GetTtySize() (uint, uint)

GetTtySize returns the height and width in characters of the tty

func (*OutStream) SetRawTerminal

func (o *OutStream) SetRawTerminal() (err error)

SetRawTerminal sets raw mode on the input terminal

func (*OutStream) Write

func (o *OutStream) Write(p []byte) (int, error)

type Streams

type Streams interface {
	Out() *OutStream
	In() *InStream
}

Streams interface

Jump to

Keyboard shortcuts

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