mirror of
https://github.com/status-im/status-go-monitor.git
synced 2025-01-12 12:24:36 +00:00
rename ID to Id
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
b43f954785
commit
b4e01ef892
8
json.go
8
json.go
@ -4,7 +4,7 @@ import "fmt"
|
||||
|
||||
type Peer struct {
|
||||
Enode string `json:"enode"`
|
||||
Id peerId `json:"id"`
|
||||
ID PeerId `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Caps []string `json:"caps"`
|
||||
Network NetworkInfo `json:"network"`
|
||||
@ -12,13 +12,13 @@ type Peer struct {
|
||||
}
|
||||
|
||||
func (p Peer) String() string {
|
||||
return fmt.Sprintf("Peer(id=%s)", p.Id)
|
||||
return fmt.Sprintf("Peer(ID=%s)", p.ID)
|
||||
}
|
||||
|
||||
type peerId string
|
||||
type PeerId string
|
||||
|
||||
// the ID is too long to display in full in most places
|
||||
func (id peerId) String() string {
|
||||
func (id PeerId) String() string {
|
||||
return fmt.Sprintf("%s...%s",
|
||||
string(id[:6]),
|
||||
string(id[len(id)-6:]))
|
||||
|
@ -47,7 +47,7 @@ func renderPeerInfo(g *gocui.Gui, peer *Peer) {
|
||||
v.Clear()
|
||||
fmt.Fprintf(v, strings.Repeat("%-8s: %v\n", 8),
|
||||
"Name", peer.Name,
|
||||
"ID", string(peer.Id),
|
||||
"ID", string(peer.ID),
|
||||
"Enode", peer.Enode,
|
||||
"Static", peer.Network.Static,
|
||||
"Trusted", peer.Network.Trusted,
|
||||
@ -76,9 +76,9 @@ func updatePeerCursor(g *gocui.Gui, current int) {
|
||||
func (p Peer) AsTable(maxWidth int) string {
|
||||
var id string
|
||||
if maxWidth > 160 {
|
||||
id = string(p.Id)
|
||||
id = string(p.ID)
|
||||
} else {
|
||||
id = p.Id.String()
|
||||
id = p.ID.String()
|
||||
}
|
||||
return fmt.Sprintf("%s | %-15s | %-21s | %-7s | %-8s",
|
||||
id, p.Name,
|
||||
|
Loading…
x
Reference in New Issue
Block a user