ev

package module
v0.0.0-...-96be48b Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustEmit

func MustEmit(fn EmitFunc) func(any)

func MustPut

func MustPut(sink Sink) func(ev *Ev)

func NewTCPServer

func NewTCPServer(ctx context.Context, addr string, upstream Sink, errCh chan error) error

Types

type Attr

type Attr struct {
	Name  string
	Value any
}

type AttrsBox

type AttrsBox func(attrs []Attr) BoxSpec

type BoxSpec

type BoxSpec struct {
	Rows []RowSpec
}

func (BoxSpec) Draw

func (b BoxSpec) Draw(screen tcell.Screen, x, y, width, height int) (dx, dy int)

func (BoxSpec) DrawLeftBottom

func (b BoxSpec) DrawLeftBottom(screen tcell.Screen, x, y, width, height int) (dx, dy int)

type CellSpec

type CellSpec struct {
	Rune  rune
	Style tcell.Style
}

func (CellSpec) Draw

func (c CellSpec) Draw(screen tcell.Screen, x, y, width, height int) int

type ClickHandler

type ClickHandler struct {
	X, Y          int
	Width, Height int
	Func          any
}

type ClickHandlers

type ClickHandlers []ClickHandler

type Dashboard

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

func NewDashboard

func NewDashboard(ctx context.Context) (*Dashboard, error)

func (*Dashboard) Close

func (d *Dashboard) Close()

func (*Dashboard) Put

func (d *Dashboard) Put(ev *Ev) error

func (*Dashboard) Run

func (d *Dashboard) Run()

type DashboardDef

type DashboardDef struct{}

func (DashboardDef) AttrsBox

func (_ DashboardDef) AttrsBox(
	styles Styles,
) AttrsBox

func (DashboardDef) ClickHandlers

func (_ DashboardDef) ClickHandlers() ClickHandlers

func (DashboardDef) DashboardRefresh

func (_ DashboardDef) DashboardRefresh(
	evs Evs,
	offset EvsOffset,
	evBox EvBox,
	mutate dscope.Mutate,
	extraAttrs ShowExtraAttrs,
	attrsBox AttrsBox,
) DashboardRefresh

func (DashboardDef) EvBox

func (_ DashboardDef) EvBox(
	styles Styles,
) EvBox

func (DashboardDef) Evs

func (_ DashboardDef) Evs() Evs

func (DashboardDef) EvsOffset

func (_ DashboardDef) EvsOffset() EvsOffset

func (DashboardDef) Refresh

func (_ DashboardDef) Refresh(
	refresh DashboardRefresh,
) Refresh

func (DashboardDef) ShowExtraAttrs

func (_ DashboardDef) ShowExtraAttrs() ShowExtraAttrs

func (DashboardDef) Styles

func (_ DashboardDef) Styles() (styles Styles)

type DashboardRefresh

type DashboardRefresh func(screen tcell.Screen)

type EmitFunc

type EmitFunc = func(any) error

func NewEmitter

func NewEmitter(sink Sink) EmitFunc

type Ev

type Ev struct {
	Name       string
	Attrs      []Attr
	ExtraAttrs []Attr
	Subs       []*Ev
}

func ToEv

func ToEv(obj any) *Ev

type EvBox

type EvBox func(ev *Ev) BoxSpec

type Evs

type Evs = []*Ev

type EvsOffset

type EvsOffset int

type PutFunc

type PutFunc func(ev *Ev) error

func (PutFunc) Put

func (p PutFunc) Put(ev *Ev) error

type PutOp

type PutOp struct {
	Ev  *Ev
	Err chan error
}

func NewPutOp

func NewPutOp(ev *Ev) PutOp

type Refresh

type Refresh func(screen tcell.Screen)

type RowSpec

type RowSpec struct {
	Cells []CellSpec
}

func (*RowSpec) AppendStr

func (r *RowSpec) AppendStr(str string, style tcell.Style)

func (RowSpec) Draw

func (r RowSpec) Draw(screen tcell.Screen, x, y, width, height int) int

type ShowExtraAttrs

type ShowExtraAttrs []Attr

type Sink

type Sink interface {
	Put(ev *Ev) error
}

type Styles

type Styles struct {
	EvName   tcell.Style
	AttrName tcell.Style
}

type TCPClient

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

func NewTCPClient

func NewTCPClient(ctx context.Context, remote string) (*TCPClient, error)

func (*TCPClient) Put

func (t *TCPClient) Put(ev *Ev) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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