2019-06-26 16:23:10 +01:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
// Router service is used by the proxy to lookup routes
|
|
|
|
service Router {
|
2019-07-10 17:21:55 +01:00
|
|
|
rpc Watch(WatchRequest) returns (stream TableEvent) {};
|
2019-06-26 16:23:10 +01:00
|
|
|
rpc Lookup(LookupRequest) returns (LookupResponse) {};
|
2019-07-10 17:21:55 +01:00
|
|
|
rpc List(ListRequest) returns (ListResponse) {};
|
2019-06-26 16:23:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// LookupRequest is made to Lookup
|
|
|
|
message LookupRequest {
|
|
|
|
Query query = 1;
|
|
|
|
}
|
|
|
|
|
2019-07-10 17:21:55 +01:00
|
|
|
// LookupResponse is returned by Lookup
|
2019-06-26 16:23:10 +01:00
|
|
|
message LookupResponse {
|
|
|
|
repeated Route routes = 1;
|
|
|
|
}
|
|
|
|
|
2019-07-10 17:21:55 +01:00
|
|
|
// WatchRequest is made to Watch Router
|
|
|
|
message WatchRequest {}
|
|
|
|
|
|
|
|
// EventType is TableEvent type
|
|
|
|
enum EventType {
|
2019-07-10 18:37:46 +01:00
|
|
|
Create = 0;
|
2019-07-10 17:21:55 +01:00
|
|
|
Delete = 1;
|
|
|
|
Update = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TableEvent is streamed by WatchRequest
|
|
|
|
message TableEvent {
|
|
|
|
// time of table event
|
|
|
|
EventType type = 1;
|
|
|
|
// unix timestamp of event
|
|
|
|
int64 timestamp = 2;
|
|
|
|
// service route
|
|
|
|
Route route = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ListRequest is made to List routes
|
|
|
|
message ListRequest {}
|
|
|
|
|
|
|
|
// ListResponse is returned by List
|
|
|
|
message ListResponse {
|
|
|
|
repeated Route routes = 1;
|
|
|
|
}
|
|
|
|
|
2019-06-26 16:23:10 +01:00
|
|
|
// Query is passed in a LookupRequest
|
|
|
|
message Query {
|
2019-07-09 16:45:31 +01:00
|
|
|
// service to lookup
|
|
|
|
string service = 1;
|
2019-06-26 16:23:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Route is a service route
|
|
|
|
message Route {
|
|
|
|
// service for the route
|
2019-07-09 16:45:31 +01:00
|
|
|
string service = 1;
|
|
|
|
// the address that advertise this route
|
|
|
|
string address = 2;
|
2019-06-26 16:23:10 +01:00
|
|
|
// gateway as the next hop
|
2019-07-09 16:45:31 +01:00
|
|
|
string gateway = 3;
|
2019-06-26 16:23:10 +01:00
|
|
|
// the network for this destination
|
|
|
|
string network = 4;
|
2019-07-09 16:45:31 +01:00
|
|
|
// the network link
|
|
|
|
string link = 5;
|
2019-06-26 16:23:10 +01:00
|
|
|
// the metric / score of this route
|
2019-07-09 16:45:31 +01:00
|
|
|
int64 metric = 6;
|
2019-06-26 16:23:10 +01:00
|
|
|
}
|