From 474525bcd6a70e51cb4f553ddc5eda2149a40744 Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Tue, 8 Sep 2015 10:47:40 +0200 Subject: [PATCH] Don't omit Node fields from JSON rendering --- report/topology.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/report/topology.go b/report/topology.go index 263cc8c1f..2e2d4aded 100644 --- a/report/topology.go +++ b/report/topology.go @@ -10,7 +10,7 @@ import ( // EdgeMetadatas and Nodes respectively. Edges are directional, and embedded // in the Node struct. type Topology struct { - Nodes + Nodes // TODO(pb): remove Nodes intermediate type } // MakeTopology gives you a Topology. @@ -48,6 +48,7 @@ func (t Topology) Merge(other Topology) Topology { } // Nodes is a collection of nodes in a topology. Keys are node IDs. +// TODO(pb): type Topology map[string]Node type Nodes map[string]Node // Copy returns a value copy of the Nodes. @@ -75,10 +76,10 @@ func (n Nodes) Merge(other Nodes) Nodes { // given node in a given topology, along with the edges emanating from the // node and metadata about those edges. type Node struct { - Metadata `json:"-"` - Counters `json:"-"` + Metadata `json:"metadata"` + Counters `json:"counters"` Adjacency IDList `json:"adjacency"` - Edges EdgeMetadatas `json:"-"` + Edges EdgeMetadatas `json:"edges"` } // MakeNode creates a new Node with no initial metadata.