5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-21 20:40:28 +00:00

Tweaks to yggdrasilctl

This commit is contained in:
Neil Alexander 2022-10-02 13:15:11 +01:00
parent 428d2375da
commit 962665189c

View File

@ -174,16 +174,16 @@ func run() int {
if err := json.Unmarshal(recv.Response, &resp); err != nil { if err := json.Unmarshal(recv.Response, &resp); err != nil {
panic(err) panic(err)
} }
table.SetHeader([]string{"Port", "Public Key", "IP Address", "Peering URI", "Uptime", "RX", "TX"}) table.SetHeader([]string{"Port", "Public Key", "IP Address", "Uptime", "RX", "TX", "URI"})
for _, peer := range resp.Peers { for _, peer := range resp.Peers {
table.Append([]string{ table.Append([]string{
fmt.Sprintf("%d", peer.Port), fmt.Sprintf("%d", peer.Port),
peer.PublicKey, peer.PublicKey,
peer.IPAddress, peer.IPAddress,
peer.Remote,
(time.Duration(peer.Uptime) * time.Second).String(), (time.Duration(peer.Uptime) * time.Second).String(),
peer.RXBytes.String(), peer.RXBytes.String(),
peer.TXBytes.String(), peer.TXBytes.String(),
peer.Remote,
}) })
} }
table.Render() table.Render()
@ -269,6 +269,8 @@ func run() int {
} }
table.Render() table.Render()
case "addpeer", "removepeer":
default: default:
fmt.Println(string(recv.Response)) fmt.Println(string(recv.Response))
} }