stream

package
v0.0.0-...-6f6f2b9 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IOStreams

type IOStreams struct {
	// In think, os.Stdin
	In io.Reader
	// Out think, os.Stdout
	Out io.Writer
	// ErrOut think, os.Stderr
	ErrOut io.Writer
}

IOStreams provides the standard names for iostreams. This is useful for embedding and for unit testing. Inconsistent and different names make it hard to read and review code

type TerminalSession

type TerminalSession struct {
	IOStreams
	// contains filtered or unexported fields
}

TerminalSession implements PtyHandler, holds information pertaining to the current streaming session: input/output streams, if the client is requesting a TTY, and a terminal size queue to support terminal resizing.

func NewTerminalSession

func NewTerminalSession(stream IOStreams) *TerminalSession

NewTerminalSession create TerminalSession

func (*TerminalSession) Done

func (t *TerminalSession) Done()

Done done, must call Done() before connection close, or Next() would not exits.

func (*TerminalSession) Next

func (s *TerminalSession) Next() *remotecommand.TerminalSize

Next returns the new terminal size after the terminal has been resized. It returns nil when session stoped.

func (*TerminalSession) Stderr

func (t *TerminalSession) Stderr() io.Writer

Stderr ...

func (*TerminalSession) Stdin

func (t *TerminalSession) Stdin() io.Reader

Stdin ...

func (*TerminalSession) Stdout

func (t *TerminalSession) Stdout() io.Writer

Stdout ...

func (*TerminalSession) Tty

func (t *TerminalSession) Tty() bool

Tty ...

Jump to

Keyboard shortcuts

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