pkg/mesh: rename mesh granularity types

This commit renames the mesh granularity types to make them more
intuitive. The functionality provided by them remains exactly the same.
This commit is contained in:
Lucas Servén Marín
2019-05-07 16:34:34 +02:00
parent c65627dab0
commit 9f30d8d1a1
5 changed files with 118 additions and 118 deletions

View File

@@ -76,18 +76,18 @@ func NewTopology(nodes map[string]*Node, peers map[string]*Peer, granularity Gra
for _, node := range nodes {
var location string
switch granularity {
case DataCenterGranularity:
case LogicalGranularity:
location = node.Location
case NodeGranularity:
case FullGranularity:
location = node.Name
}
topoMap[location] = append(topoMap[location], node)
}
var localLocation string
switch granularity {
case DataCenterGranularity:
case LogicalGranularity:
localLocation = nodes[hostname].Location
case NodeGranularity:
case FullGranularity:
localLocation = hostname
}