Added comments for CmdGenerator and RegisterCustomCmdGenerator

This commit is contained in:
Francis Lam 2014-02-08 17:55:11 -05:00
parent 773efd633d
commit bfe374e735

View file

@ -53,10 +53,14 @@ func RegisterCustomCmd(method string, parser RawCmdParser, helpString string) {
customCmds[method] = cmd{parser: parser, helpString: helpString}
}
// CmdGenerator is a function that returns a new concerete Cmd of
// the appropriate type for a non-standard Bitcoin command.
type CmdGenerator func() Cmd
var customCmdGenerators = make(map[string]CmdGenerator)
// RegisterCustomCmdGenerator registers a custom CmdGenerator func for
// a non-standard Bitcoin command.
func RegisterCustomCmdGenerator(method string, generator CmdGenerator) {
customCmdGenerators[method] = generator
}