mux

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 6 Imported by: 0

README

mux

Package mux defines Screen and Stream, two of cy's core abstractions for representing interactive windows and streams of terminal data, respectively. It also contains a wide range of useful Screens and Streams used across cy.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Msg added in v0.1.6

type Msg = events.Msg

type Resizable

type Resizable interface {
	Resize(size Size) error
}

type Screen

type Screen interface {
	State() *tty.State
	Subscribe(context.Context) *Updater
	Resizable
	Send(message events.Msg)
}

A Screen is a resizable box that can publish updates.

type Size

type Size = geom.Vec2

type Stream

type Stream interface {
	io.ReadWriter
	Resizable
}

A Stream accepts input (Write) and resize events and produces output (Read).

type UpdatePublisher

type UpdatePublisher struct {
	*util.Publisher[events.Msg]
}

func NewPublisher

func NewPublisher() *UpdatePublisher

func (*UpdatePublisher) Notify added in v0.1.6

func (u *UpdatePublisher) Notify()

type Updater

type Updater = util.Subscriber[events.Msg]

Directories

Path Synopsis
cli

Jump to

Keyboard shortcuts

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