From bfe374e735eaa99b9ce1dabc3cba6488615e8685 Mon Sep 17 00:00:00 2001 From: Francis Lam Date: Sat, 8 Feb 2014 17:55:11 -0500 Subject: [PATCH] Added comments for CmdGenerator and RegisterCustomCmdGenerator --- jsoncmd.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jsoncmd.go b/jsoncmd.go index a1b97e96..e8ffe687 100644 --- a/jsoncmd.go +++ b/jsoncmd.go @@ -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 }