Advertisement is now Update; started bit is now running.
This commit is contained in:
		| @@ -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 | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user