setting

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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
)
View Source
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 Opt

type Opt struct {
	Description string
	Val         interface{}
}

Opt houses some options

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) Get

func (s *ShellVars) Get(opt string) (*Opt, bool)

Get returns the specified option's pointer, or false if it doesn't exist

func (*ShellVars) GetB

func (s *ShellVars) GetB(opt string) (bool, bool)

GetB returns the specified option's value as a bool, or false if it doesn't exist

func (*ShellVars) GetF

func (s *ShellVars) GetF(opt string) (float64, bool)

GetF returns the specified option's value as an float64, or false if it doesn't exist

func (*ShellVars) GetS

func (s *ShellVars) GetS(opt string) (string, bool)

GetS returns the specified option's value as a string, or false if it doesn't exist

func (*ShellVars) Set

func (s *ShellVars) Set(opt string, val interface{}) bool

Set sets opt to val

func (*ShellVars) UpdateCallCompleter

func (s *ShellVars) UpdateCallCompleter(list map[string]interface{})

UpdateCallCompleter generates the completer for the "call" command supplied via a map generated by the "list" method

func (*ShellVars) UpdateCompleter

func (s *ShellVars) UpdateCompleter(cmdlist map[string]cmd.Command)

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

Jump to

Keyboard shortcuts

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