monitor

package
v0.0.0-...-bb4fd4e Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimeout error = errors.New("timed out")
)

Functions

func Monitor

func Monitor(mio MonitorIO, bus *Bus, opts ...interface{})

Monitor I/O via Bus

func Terminated

func Terminated(s string, terminators []string) bool

Types

type Bus

type Bus struct {
	In        chan string
	Out       chan string
	Operation chan Operator
	Done      chan bool
	Timeout   time.Duration
	Err       chan error
}

Bus - i/o communications

func NewBus

func NewBus() (bus *Bus)

NewBus creates an i/o bus

func (*Bus) Capture

func (bus *Bus) Capture(out string, terminators ...string) (results []string, err error)

type Connector

type Connector interface {
	Connect(*Bus) (Controller, error)
	Save() error
	Load() error
}

type Controller

type Controller interface {
	Descriptor() (s string)
	Views() (vs []*View)
	Upload(w io.Writer, files []string) (err error)
	View(w io.Writer, view string) (err error)
	Edit(w io.Writer, view, key string) (err error)
	Apply(view, key string, vals map[string][]string) ([]*forms.Updated, error)
	Query(view, key string) (err error)
}

type Manager

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

func NewManager

func NewManager() (mgr *Manager)

func (*Manager) AddConnector

func (mgr *Manager) AddConnector(c Connector)

func (*Manager) AddProvider

func (mgr *Manager) AddProvider(d Provider)

type MonitorIO

type MonitorIO interface {
	Open(...interface{}) (io.Reader, io.Writer, error)
	Close() error
}

MonitorIO -

type Operator

type Operator int
const (
	Open Operator = iota
	Close
)

type Provider

type Provider interface {
	Update(...string) []string
	List() []string
	Get(string) (MonitorIO, error)
}

type View

type View struct {
	ID    string
	Title string
	Icon  string
	Path  string
}

Jump to

Keyboard shortcuts

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