Added Entry type. Basic implementation of Router and Table

This commit is contained in:
Milos Gajdos
2019-06-09 23:09:38 +01:00
parent ad92e6821e
commit 9c57f32f58
6 changed files with 237 additions and 79 deletions

View File

@@ -45,27 +45,3 @@ func RoutingTable(t Table) Option {
o.Table = t
}
}
// RouteOptions allows to specify routing table options
type RouteOptions struct {
// NetID is network ID
NetID string
// Metric is route metric
Metric int
// COntext allows to specify other arbitrary options
Context context.Context
}
// NetID allows to set micro network ID
func NetID(id string) RouteOption {
return func(o *RouteOptions) {
o.NetID = id
}
}
// Metric allows to set route cost metric
func Metric(m int) RouteOption {
return func(o *RouteOptions) {
o.Metric = m
}
}