Reorganised source. Renamed files. No Code change.
This commit is contained in:
@@ -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...)
|
||||
|
||||
Reference in New Issue
Block a user