console

package
v0.0.0-...-e258458 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CommandUnknown = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandHandler

type CommandHandler interface {
	HandleCommand(cmd CommandInfo) (exitCode int)
}

type CommandHandlerFunc

type CommandHandlerFunc func(cmd CommandInfo) (exitCode int)

func (CommandHandlerFunc) HandleCommand

func (fn CommandHandlerFunc) HandleCommand(cmd CommandInfo) (exitCode int)

type CommandInfo

type CommandInfo struct {
	Cmd    string
	Argv   []string
	Stdout io.Writer
}

type Commands

type Commands map[string]CommandHandler

func (Commands) HandleCommand

func (cmds Commands) HandleCommand(info CommandInfo) (exitCode int)

type Console

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

func New

func New(serial Serialer, handler CommandHandler) *Console

func (*Console) Task

func (c *Console) Task()

func (*Console) Write

func (c *Console) Write(b []byte) (n int, err error)

func (*Console) WriteString

func (c *Console) WriteString(s string) (n int, err error)

type Serialer

type Serialer interface {
	io.Writer
	io.ByteReader
	io.ByteWriter
	Buffered() int
}

const storageBufLen = 512

Jump to

Keyboard shortcuts

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