stream

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SPIN_NUM_TRIES = 3
	SPIN_THRESHOLD = 1 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	deadlock.RWMutex
	// contains filtered or unexported fields
}

func NewCmd

func NewCmd(ctx context.Context, options CmdOptions, size Size) (*Cmd, error)

func (*Cmd) GetStatus

func (c *Cmd) GetStatus() CmdStatus

func (*Cmd) Path

func (c *Cmd) Path() (string, error)

func (*Cmd) Read

func (c *Cmd) Read(p []byte) (n int, err error)

func (*Cmd) Resize

func (c *Cmd) Resize(size Size) error

func (*Cmd) Subscribe

func (c *Cmd) Subscribe() *util.Subscriber[CmdStatus]

func (*Cmd) Write

func (c *Cmd) Write(data []byte) (n int, err error)

type CmdOptions

type CmdOptions struct {
	Directory string
	Command   string
	Args      []string
}

type CmdStatus

type CmdStatus int
const (
	CmdStatusStarting CmdStatus = iota
	CmdStatusHealthy
	CmdStatusFailed
)

type Notifier

type Notifier = mux.Updater

type Reader

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

func NewReader

func NewReader() *Reader

func (*Reader) Read

func (s *Reader) Read(p []byte) (n int, err error)

func (*Reader) Resize

func (s *Reader) Resize(size Size) error

Resizing does nothing to a stream.

func (*Reader) Write

func (s *Reader) Write(data []byte) (n int, err error)

func (*Reader) Writer

func (s *Reader) Writer() io.Writer

Return the handle that allows you to write to this stream.

type Renderer

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

A Renderer produces the stream of bytes necessary to render a Screen to a destination terminal. Conceptually, it is the opposite of a Screen, which takes an IO and feeds it to a virtual terminal emulator. A Renderer takes a Screen and makes an IO. This is useful because an IO may produce many more writes than are actually necessary to change the screen; a Renderer can make optimizations to only update the parts of the screen that have changed.

func NewRenderer

func NewRenderer(
	ctx context.Context,
	info *terminfo.Terminfo,
	target emu.Terminal,
	screen Screen,
) *Renderer

func (*Renderer) Read

func (r *Renderer) Read(p []byte) (n int, err error)

func (*Renderer) Resize

func (r *Renderer) Resize(size Size) error

func (*Renderer) Write

func (r *Renderer) Write(data []byte) (n int, err error)

type Screen

type Screen = mux.Screen

type Size

type Size = mux.Size

type Stream

type Stream = mux.Stream

Jump to

Keyboard shortcuts

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