Big refactor. New Registry watchers. New options. New names.

This commit is contained in:
Milos Gajdos
2019-06-12 22:30:42 +01:00
parent 338e0fdf18
commit 95fc625e99
8 changed files with 346 additions and 90 deletions

View File

@@ -3,26 +3,22 @@ package router
// Router is micro network router
type Router interface {
// Initi initializes Router with options
// Init initializes the router with options
Init(...Option) error
// Options returns Router options
// Options returns the router options
Options() Options
// Table returns routing table
Table() Table
// Address returns router adddress
Address() string
// Gossip returns router gossip address
Gossip() string
// Network returns router network address
Network() string
// Start starts router
// Start starts the router
Start() error
// Stop stops router
// Stop stops the router
Stop() error
// String returns router debug info
String() string
}
// RIB is Routing Information Base
type RIB interface {
// String returns debug info
String() string
}
@@ -30,6 +26,9 @@ type RIB interface {
// Option used by the router
type Option func(*Options)
// RIBOptopn is used to configure RIB
type RIBOption func(*RIBOptions)
// RouteOption is used to define routing table entry options
type RouteOption func(*RouteOptions)