Export NodeInfoPayload type, rename some API functions

This commit is contained in:
Neil Alexander 2019-07-28 11:30:24 +01:00
parent 377f88512b
commit 24f4754f2b
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
4 changed files with 27 additions and 38 deletions

View file

@ -85,14 +85,15 @@ func (a *AdminSocket) Init(c *yggdrasil.Core, state *config.NodeState, log *log.
*/
a.AddHandler("getSelf", []string{}, func(in Info) (Info, error) {
ip := c.Address().String()
subnet := c.Subnet()
return Info{
"self": Info{
ip: Info{
"box_pub_key": c.BoxPubKey(),
"box_pub_key": c.EncryptionPublicKey(),
"build_name": yggdrasil.BuildName(),
"build_version": yggdrasil.BuildVersion(),
"coords": fmt.Sprintf("%v", c.Coords()),
"subnet": c.Subnet().String(),
"subnet": subnet.String(),
},
},
}, nil