Add type core.AddHandlerFunc

This commit is contained in:
Alex Kotov 2021-09-01 06:16:57 +05:00
parent 3613614b41
commit 538ee13669
No known key found for this signature in database
GPG key ID: 553C0EBBEB5D5F08
2 changed files with 6 additions and 4 deletions

View file

@ -242,9 +242,11 @@ func (c *Core) PublicKey() ed25519.PublicKey {
// Hack to get the admin stuff working, TODO something cleaner
type AddHandler interface {
AddHandler(name string, args []string, handlerfunc func(json.RawMessage) (interface{}, error)) error
AddHandler(name string, args []string, handlerfunc AddHandlerFunc) error
}
type AddHandlerFunc func(json.RawMessage) (interface{}, error)
// SetAdmin must be called after Init and before Start.
// It sets the admin handler for NodeInfo and the Debug admin functions.
func (c *Core) SetAdmin(a AddHandler) error {