asciitransport

package module
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsciiTransport

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

func (*AsciiTransport) ApplyOpts

func (at *AsciiTransport) ApplyOpts(opts ...Opt)

func (*AsciiTransport) Close

func (c *AsciiTransport) Close() error

func (*AsciiTransport) Done

func (c *AsciiTransport) Done() <-chan struct{}

func (*AsciiTransport) Input

func (c *AsciiTransport) Input(buf []byte)

func (*AsciiTransport) InputEvent

func (s *AsciiTransport) InputEvent() <-chan *InputEvent

func (*AsciiTransport) InputFrom

func (c *AsciiTransport) InputFrom(r io.Reader) error

func (*AsciiTransport) Output

func (c *AsciiTransport) Output(buf []byte)

func (*AsciiTransport) OutputEvent

func (c *AsciiTransport) OutputEvent() <-chan *OutputEvent

func (*AsciiTransport) OutputFrom

func (c *AsciiTransport) OutputFrom(r io.Reader) error

func (*AsciiTransport) Resize

func (c *AsciiTransport) Resize(height, width uint)

func (*AsciiTransport) ResizeEvent

func (s *AsciiTransport) ResizeEvent() <-chan *ResizeEvent

type AsciiTransportClient

type AsciiTransportClient interface {
	OutputEvent() <-chan *OutputEvent
	Input([]byte)
	InputFrom(io.Reader) error
	Resize(uint, uint)
	Done() <-chan struct{}
	Close() error
}

func Client

func Client(conn io.ReadWriteCloser, opts ...Opt) AsciiTransportClient

type AsciiTransportServer

type AsciiTransportServer interface {
	ResizeEvent() <-chan *ResizeEvent
	InputEvent() <-chan *InputEvent
	Output([]byte)
	OutputFrom(io.Reader) error
	Done() <-chan struct{}
	Close() error
	ApplyOpts(...Opt)
}

func Server

func Server(conn io.ReadWriteCloser, opts ...Opt) AsciiTransportServer

type Event

type Event cast.Event

func (*Event) UnmarshalJSON

func (e *Event) UnmarshalJSON(buf []byte) error

type InputEvent

type InputEvent Event

func (*InputEvent) String

func (e *InputEvent) String() string

type Logger

type Logger interface {
	Print(v interface{})
	Close() error
}

func NewLogger

func NewLogger(w io.WriteCloser) Logger

type Opt

type Opt func(at *AsciiTransport)

func WithCommand

func WithCommand(c []string) Opt

func WithEnv

func WithEnv(env map[string]string) Opt

func WithLogger

func WithLogger(w io.WriteCloser) Opt

func WithReader

func WithReader(r io.Reader) Opt

func WithWriter

func WithWriter(w io.Writer) Opt

type OutputEvent

type OutputEvent Event

func (*OutputEvent) String

func (e *OutputEvent) String() string

type PingEvent

type PingEvent Event

func (*PingEvent) String

func (e *PingEvent) String() string

type ResizeEvent

type ResizeEvent cast.Header

func (*ResizeEvent) String

func (e *ResizeEvent) String() string

type Resizer

type Resizer interface {
	Resize(height, width uint16)
}

Directories

Path Synopsis
Package cast contains the essential structures for dealing with an asciinema cast of the v2 format.
Package cast contains the essential structures for dealing with an asciinema cast of the v2 format.

Jump to

Keyboard shortcuts

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