tty

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(ctx context.Context, dst net.Conn, src io.Reader, readTimeout time.Duration) (written int64, err error)

func MonitorTtySize

func MonitorTtySize(ctx context.Context, client client.ContainerAPIClient, out *stream.OutStream, id string, isExec bool) error

MonitorTtySize updates the container tty size when the terminal tty changes size

func ResizeTtyTo

func ResizeTtyTo(ctx context.Context, client client.ContainerAPIClient, id string, height, width uint, isExec bool)

ResizeTtyTo re sizes tty to specific height and width

Types

type HijackedIOStreamer

type HijackedIOStreamer struct {
	Streams      stream.Streams
	InputStream  io.ReadCloser
	OutputStream io.Writer
	ErrorStream  io.Writer

	Resp types.HijackedResponse

	TTY        bool
	DetachKeys string
}

HijackedIOStreamer handles copying input to and output from streams to the connection.

func (*HijackedIOStreamer) Stream

func (h *HijackedIOStreamer) Stream(ctx context.Context, readTimeout time.Duration) error

Stream handles setting up the IO and then begins streaming stdin/stdout to/from the hijacked connection, blocking until it is either done reading output, the user inputs the detach key sequence when in TTY mode, or when the given context is cancelled.

Jump to

Keyboard shortcuts

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