Advertisement is now Update; started bit is now running.

This commit is contained in:
Milos Gajdos
2019-06-28 11:53:55 +01:00
parent 9d7420658d
commit 8ad2f73ad6
2 changed files with 30 additions and 16 deletions

View File

@@ -1,6 +1,8 @@
// Package router provides a network routing control plane
package router
import "time"
var (
// DefaultRouter is default network router
DefaultRouter = NewRouter()
@@ -21,19 +23,21 @@ type Router interface {
// Network returns the network address of the router
Network() string
// Advertise starts advertising routes to the network
Advertise() (<-chan *Advertisement, error)
Advertise() (<-chan *Update, error)
// Update updates the routing table
Update(*Advertisement) error
Update(*Update) error
// Stop stops the router
Stop() error
// String returns debug info
String() string
}
// Advertisement is sent by the router to the network
type Advertisement struct {
// Update is sent by the router to the network
type Update struct {
// ID is the source router ID
ID string
// Timestamp marks the time when update is sent
Timestamp time.Time
// Event defines advertisement even
Event *Event
}