Documentation ¶
Overview ¶
Package cli provides all methods to control command line functions
Index ¶
- func CMDRgx() *regexp.Regexp
- func Flag(args string) (string, map[string]interface{})
- func GetCMDNames(s interface{}) []string
- func GetOptions(s interface{}, key string) ([]string, []interface{})
- func InitConfig(f string) ([]byte, error)
- func SetConfig(args string, s *Config) error
- func SetFlag(flag map[string]interface{}, option string, v interface{}) interface{}
- func SetValue(v reflect.Value, rec string, val interface{}) error
- func ShowConfig(s *Config)
- func UpgradeConfig(cfg *Config) error
- func WriteConfig(cfg Config) error
- type Config
- type HPing
- type Ping
- type Readline
- func (r *Readline) AddCompleter(pcItem string, pcSubItems []string)
- func (r *Readline) Close(next chan struct{})
- func (r *Readline) GetPrompt() string
- func (r *Readline) Help()
- func (r *Readline) Next()
- func (r *Readline) Refresh()
- func (r *Readline) RemoveItemCompleter(pcItem string)
- func (r *Readline) Run(cmd chan<- string, next chan struct{})
- func (r *Readline) SetEmacs()
- func (r *Readline) SetPrompt(p string)
- func (r *Readline) SetVim()
- func (r *Readline) UpdateCompleter(pcItem string, pcSubItems []string)
- func (r *Readline) UpdatePromptN(p string, n int)
- type SNMP
- type Scan
- type Trace
- type Web
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOptions ¶
GetOptions returns option(s)/value(s) for specific command
func UpgradeConfig ¶
UpgradeConfig adds / removes new command(s)/option(s)
Types ¶
type Config ¶
type Config struct { Ping Ping `json:"ping"` Hping HPing `json:"hping"` Web Web `json:"web"` Scan Scan `json:"scan"` Trace Trace `json:"trace"` Snmp SNMP `json:"snmp"` }
Config represents configuration
func ReadConfig ¶
func ReadConfig() Config
ReadConfig reads configuration from existing or default configuration
func ReadDefaultConfig ¶
ReadDefaultConfig returns default configuration
type HPing ¶
type HPing struct { Timeout string `json:"timeout" tag:"lower"` Interval string `json:"interval" tag:"lower"` Method string `json:"method" tag:"upper"` Data string `json:"data"` Count int `json:"count"` }
HPing represents ping command options
type Ping ¶
type Ping struct { Timeout string `json:"timeout" tag:"lower"` Interval string `json:"interval" tag:"lower"` Count int `json:"count"` }
Ping represents ping command options
type Readline ¶
type Readline struct {
// contains filtered or unexported fields
}
Readline structure
func (*Readline) AddCompleter ¶
AddCompleter updates subitem(s) from a specific main item
func (*Readline) RemoveItemCompleter ¶
RemoveItemCompleter removes subitem(s) from a specific main item
func (*Readline) UpdateCompleter ¶
UpdateCompleter updates subitem(s) from a specific main item
func (*Readline) UpdatePromptN ¶
UpdatePromptN appends readline prompt
type SNMP ¶
type SNMP struct { Community string `json:"community"` Timeout string `json:"timeout" tag:"lower"` Version string `json:"version" tag:"lower"` Retries int `json:"retries"` Port int `json:"port"` Securitylevel string `json:"securitylevel"` Authpass string `json:"authpass"` Authproto string `json:"authproto" tag:"lower"` Privacypass string `json:"privacypass"` Privacyproto string `json:"privacyproto" tag:"lower"` }
SNMP represents nms command options