Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //NotFoundError route not found error ErrNotFound = errors.New("Route could not found") )
Functions ¶
This section is empty.
Types ¶
type RouteManager ¶
type RouteManager interface { //IsRegistered returns true if a Route (by it's name) is already managed IsRegistered(string) bool //RegisterRoute creates and start watching the route. If the route is deleted after the registration, RouteWatchers will be notified. RegisterRoute(string, Route) error //DeRegisterRoute removed the route from the kernel and also stop watching it. DeRegisterRoute(string) error //RegisterWatcher registers a new RouteWatcher, which will be notified if the managed routes are deleted. RegisterWatcher(RouteWatcher) //DeRegisterWatcher removes watchers DeRegisterWatcher(RouteWatcher) //Run is the main event loop, shall run in it's own go-routine. Returns when the channel sent in got closed. Run(chan struct{}) error }
RouteManager is the main interface, which is implemented by the package
func New ¶
func New() RouteManager
New creates a RouteManager for production use. It populates the routeManagerImpl structure with the final pointers to netlink package's functions.
type RouteWatcher ¶
type RouteWatcher interface {
RouteDeleted(Route)
}
RouteWatcher is a user-implemented interface, where RouteManager will call back if a managed route is damaged
Click to show internal directories.
Click to hide internal directories.