Reorganised source. Renamed files. No Code change.

This commit is contained in:
Milos Gajdos
2019-06-13 12:09:49 +01:00
parent 95fc625e99
commit 6e669d4611
9 changed files with 295 additions and 246 deletions

View File

@@ -1,19 +1,26 @@
// Package router provides an interface for micro network router
package router
import "errors"
var (
// ErrNotImplemented is returned when some functionality has not been implemented
ErrNotImplemented = errors.New("not implemented")
)
// Router is micro network router
type Router interface {
// Init initializes the router with options
Init(...Option) error
// Options returns the router options
Options() Options
// Table returns routing table
// Table returns the router routing table
Table() Table
// Address returns router adddress
// Address returns the router adddress
Address() string
// Gossip returns router gossip address
// Gossip returns the router gossip address
Gossip() string
// Network returns router network address
// Network returns the router network address
Network() string
// Start starts the router
Start() error
@@ -26,18 +33,6 @@ type Router 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)
// QueryOption is used to define query options
type QueryOption func(*QueryOptions)
// WatchOption is used to define what routes to watch in the table
type WatchOption func(*WatchOptions)
// NewRouter creates new Router and returns it
func NewRouter(opts ...Option) Router {
return newRouter(opts...)