1
0
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:
deadprogram 2016-12-01 20:40:58 +01:00
parent 0764500955
commit ad339b9ace

View File

@ -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
}