commands

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DecimalValue = iota
	FloatValue
	StringValue
	BoolValue
)

Variables

View Source
var (
	NotEnoughParameterError = errors.New("not enough parameter")
	IllegalParameterError   = errors.New("illegal parameter")
)

Functions

This section is empty.

Types

type Command

type Command struct {
	Name    string
	Params  CommandParameters
	Handler CommandHandler
}

func (*Command) Exec

func (c *Command) Exec(in io.Reader, out io.Writer) error

type CommandHandler

type CommandHandler func(params CommandParameters, in io.Reader, out io.Writer) error

type CommandParameter

type CommandParameter struct {
	Label     string
	ValueType CommandParameterType
	Value     string
}

type CommandParameterType

type CommandParameterType int

type CommandParameters

type CommandParameters []CommandParameter

func (CommandParameters) GetParameter

func (p CommandParameters) GetParameter(label string, idx int) (interface{}, bool)

func (CommandParameters) Size

func (p CommandParameters) Size() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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