mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-04-24 13:48:49 +08:00
docs: Add missing godocs for Commander type
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
0764500955
commit
ad339b9ace
@ -22,15 +22,18 @@ func NewCommander() Commander {
|
||||
}
|
||||
}
|
||||
|
||||
// Command returns the command interface whene passed a valid command name
|
||||
func (c *commander) Command(name string) (command func(map[string]interface{}) interface{}) {
|
||||
command, _ = c.commands[name]
|
||||
return
|
||||
}
|
||||
|
||||
// Commands returns the entire map of valid commands
|
||||
func (c *commander) Commands() map[string]func(map[string]interface{}) interface{} {
|
||||
return c.commands
|
||||
}
|
||||
|
||||
// AddCommand adds a new command, when passed a command name and the command interface.
|
||||
func (c *commander) AddCommand(name string, command func(map[string]interface{}) interface{}) {
|
||||
c.commands[name] = command
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user