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 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
type Serialer ¶
type Serialer interface { io.Writer io.ByteReader io.ByteWriter Buffered() int }
const storageBufLen = 512
Click to show internal directories.
Click to hide internal directories.