Make various anonymous fields named

Anonymous fields make any methods on the inner object visible on the
outer, so they should only be used when the outer is-a inner.
This commit is contained in:
Bryan Boreham
2017-04-01 11:35:10 +00:00
parent 8feda14827
commit 515f4b1a47
3 changed files with 10 additions and 10 deletions

View File

@@ -54,7 +54,7 @@ type kv interface {
}
type consulClient struct {
kv
kv kv
}
// Get and deserialise a JSON value from consul.

View File

@@ -23,7 +23,7 @@ type Connection struct {
RemoteAddress net.IP
RemotePort uint16
inode uint64
Proc
Proc Proc
}
// Proc is a single process with PID and process name.

View File

@@ -10,14 +10,14 @@ import (
// EdgeMetadatas and Nodes respectively. Edges are directional, and embedded
// in the Node struct.
type Topology struct {
Shape string `json:"shape,omitempty"`
Label string `json:"label,omitempty"`
LabelPlural string `json:"label_plural,omitempty"`
Nodes `json:"nodes"`
Controls `json:"controls,omitempty"`
MetadataTemplates `json:"metadata_templates,omitempty"`
MetricTemplates `json:"metric_templates,omitempty"`
TableTemplates `json:"table_templates,omitempty"`
Shape string `json:"shape,omitempty"`
Label string `json:"label,omitempty"`
LabelPlural string `json:"label_plural,omitempty"`
Nodes Nodes `json:"nodes"`
Controls Controls `json:"controls,omitempty"`
MetadataTemplates MetadataTemplates `json:"metadata_templates,omitempty"`
MetricTemplates MetricTemplates `json:"metric_templates,omitempty"`
TableTemplates TableTemplates `json:"table_templates,omitempty"`
}
// MakeTopology gives you a Topology.