Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InputConsole ¶
type InputConsole struct {
// contains filtered or unexported fields
}
InputConsole represents a console in which the input text is kept separate from the output text. You will be able to type on the input line without the output lines interfering with it.
func NewInputConsole ¶
func NewInputConsole() *InputConsole
NewInputConsole creates a new instance of an InputConsole.
func (*InputConsole) ListenForInput ¶
func (ic *InputConsole) ListenForInput(prompt string)
ListenForInput will listen for input on a new thread using the specified prompt.
func (*InputConsole) RegisterCommand ¶
func (ic *InputConsole) RegisterCommand( name string, action func([]string), )
RegisterCommand will register a command with the specified name and action. The action callback should take an array of strings that will represent the arguments passed to the command.
func (*InputConsole) SetUnknownCommandHandler ¶
func (ic *InputConsole) SetUnknownCommandHandler( handler func(string) bool, )
SetUnknownCommandHandler will set the handler to use for unknown commands. The handler will be passed the full command string and should return a boolean indicating whether or not the command was handled by the handler.
func (*InputConsole) Writef ¶
func (ic *InputConsole) Writef(format string, vargs ...interface{})
Writef will write a message to the InputConsole using the specified format and arguments.