Documentation ¶
Index ¶
- Variables
- func GetResponse(id int) connection.Response
- type Opt
- type ShellVars
- func (s *ShellVars) Get(opt string) (*Opt, bool)
- func (s *ShellVars) GetB(opt string) (bool, bool)
- func (s *ShellVars) GetF(opt string) (float64, bool)
- func (s *ShellVars) GetS(opt string) (string, bool)
- func (s *ShellVars) Set(opt string, val interface{}) bool
- func (s *ShellVars) UpdateCallCompleter(list map[string]interface{})
- func (s *ShellVars) UpdateCompleter(cmdlist map[string]cmd.Command)
- func (s *ShellVars) UpdatePrompt()
Constants ¶
This section is empty.
Variables ¶
var ( // ConnChannel listens for connection requests ConnChannel = make(chan []string) // ScriptIn listens for script run requests ScriptIn = make(chan []string) // ScriptRet houses return codes from scripts ScriptRet = make(chan error) // In receives incoming messages In = make(chan interface{}) // Out houses outgoing messages Out = make(chan interface{}) // PassBack returns a response to a command if requested PassBack = make(chan connection.Response) // PassBackID houses ID waiting for a response PassBackID = -1 )
var Vars = *genVars()
Vars is an instance of ShellVars
Functions ¶
func GetResponse ¶
func GetResponse(id int) connection.Response
GetResponse can be used by commands to get a response
Types ¶
type ShellVars ¶
type ShellVars struct { Conn *connection.Connection Completer readline.PrefixCompleter Instance *readline.Instance Opts map[string]*Opt }
ShellVars house some important structs, so they can be accessed elsewhere
func (*ShellVars) GetB ¶
GetB returns the specified option's value as a bool, or false if it doesn't exist
func (*ShellVars) GetF ¶
GetF returns the specified option's value as an float64, or false if it doesn't exist
func (*ShellVars) GetS ¶
GetS returns the specified option's value as a string, or false if it doesn't exist
func (*ShellVars) UpdateCallCompleter ¶
UpdateCallCompleter generates the completer for the "call" command supplied via a map generated by the "list" method
func (*ShellVars) UpdateCompleter ¶
UpdateCompleter adds commands registered with .Register() to the autocompleter
func (*ShellVars) UpdatePrompt ¶
func (s *ShellVars) UpdatePrompt()
UpdatePrompt refreshes the prompt and sets it according to current status