Route per service node. No Network Registry for now.

This commit is contained in:
Milos Gajdos
2019-06-26 16:03:19 +01:00
parent 4cad7697cc
commit fe84a2d726
6 changed files with 110 additions and 222 deletions

View File

@@ -20,7 +20,7 @@ type RoutePolicy int
const (
// OverrideIfExists overrides route if it already exists
OverrideIfExists RoutePolicy = iota
// IgnoreIfExists does not modify existing route
// IgnoreIfExists instructs to not modify existing route
IgnoreIfExists
)
@@ -40,8 +40,10 @@ func (p RoutePolicy) String() string {
type Route struct {
// Destination is destination address
Destination string
// Router is the network router
Router Router
// Gateway is route gateway
Gateway string
// Router is the network router address
Router string
// Network is micro network address
Network string
// Metric is the route cost metric
@@ -57,11 +59,12 @@ func (r *Route) String() string {
// create nice table printing structure
table := tablewriter.NewWriter(sb)
table.SetHeader([]string{"Destination", "Router", "Network", "Metric"})
table.SetHeader([]string{"Destination", "Gateway", "Router", "Network", "Metric"})
strRoute := []string{
r.Destination,
r.Router.Address(),
r.Gateway,
r.Router,
r.Network,
fmt.Sprintf("%d", r.Metric),
}