console

package
v0.0.0-...-e643345 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2017 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReaderBuilder = builder.Register(rBuilder{}, readline.Instance{}).(rBuilder)

Functions

func CmdFactory

func CmdFactory(name string) (commandFactory, bool)

func CommandFactories

func CommandFactories() map[string]commandFactory

Types

type ArgProvider

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

func NewProvider

func NewProvider(cmdName string, args []string) *ArgProvider

func (*ArgProvider) CommandName

func (p *ArgProvider) CommandName() string

func (*ArgProvider) GetInt

func (p *ArgProvider) GetInt() (int, error)

func (*ArgProvider) GetString

func (p *ArgProvider) GetString() (string, error)

func (*ArgProvider) HasMore

func (p *ArgProvider) HasMore() bool

type CmdHandler

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

func NewHandler

func NewHandler(parser IParser) *CmdHandler

func (*CmdHandler) Handle

func (h *CmdHandler) Handle(client core.IClient, input string) error

type CmdParser

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

func NewParser

func NewParser(prefix string) *CmdParser

func (*CmdParser) Parse

func (p *CmdParser) Parse(input string) (IProvider, error)

type Command

type Command func() error

func NewCommand

func NewCommand(client core.IClient, name string, provider IProvider) (Command, error)

type IHandler

type IHandler interface {
	Handle(client core.IClient, input string) error
}

type IParser

type IParser interface {
	Parse(input string) (IProvider, error)
}

type IProvider

type IProvider interface {
	HasMore() bool
	CommandName() string
	GetString() (string, error)
	GetInt() (int, error)
}

Jump to

Keyboard shortcuts

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