Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CommanderList []Commander
CommanderList contains a list of available commands
View Source
var CommandsData struct { Commands []struct { Name string Hostname string Command string Regex string Example string } }
CommandsData holds the commands in the json format read from commands.json
Functions ¶
Types ¶
type Commander ¶
type Commander interface { GetName() string GetCatagory() string MatchCommand(string) bool Execute(payload.Handler) (map[string]interface{}, error) }
Commander interface
func GetCommander ¶
GetCommander returns an appropriate Commander by matching the text with existing templates
type DialogFlowCommand ¶
type DialogFlowCommand struct { Name string Catagory string OutputFormat string Scope int64 RegexPattern *regexp.Regexp }
DialogFlowCommand structure
func (DialogFlowCommand) Execute ¶
func (uc DialogFlowCommand) Execute(payload payload.Handler) (map[string]interface{}, error)
Execute the given command
func (DialogFlowCommand) GetCatagory ¶
func (uc DialogFlowCommand) GetCatagory() string
GetCatagory of the given command
func (DialogFlowCommand) GetName ¶
func (uc DialogFlowCommand) GetName() string
GetName of the given command
func (DialogFlowCommand) GetScope ¶
func (uc DialogFlowCommand) GetScope() int64
GetScope required to execute this command
func (DialogFlowCommand) MatchCommand ¶
func (uc DialogFlowCommand) MatchCommand(text string) bool
MatchCommand based of regex
type LocalBashCommand ¶
type LocalBashCommand struct { Command string Name string Catagory string OutputFormat string Scope int64 RegexPattern *regexp.Regexp }
LocalBashCommand structure
func (LocalBashCommand) Execute ¶
func (bc LocalBashCommand) Execute(payloadHandler payload.Handler) (map[string]interface{}, error)
Execute given command
func (LocalBashCommand) GetCatagory ¶
func (bc LocalBashCommand) GetCatagory() string
GetCatagory that was executed
func (LocalBashCommand) GetName ¶
func (bc LocalBashCommand) GetName() string
GetName the name of the command that was execute
func (LocalBashCommand) GetScope ¶
func (bc LocalBashCommand) GetScope() int64
GetScope that is required to run this command
func (LocalBashCommand) MatchCommand ¶
func (bc LocalBashCommand) MatchCommand(text string) bool
MatchCommand from the list of commands
Click to show internal directories.
Click to hide internal directories.