mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
50 lines
981 B
Protocol Buffer
50 lines
981 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
package routing;
|
|
option go_package = "./proto;routing";
|
|
|
|
service Routing {
|
|
// Route returns a gps route from origin to destination based on lat/lng
|
|
rpc Route(RouteRequest) returns (RouteResponse) {}
|
|
// Eta returns an estimated time of arrival for a route
|
|
rpc Eta(EtaRequest) returns (EtaResponse) {}
|
|
}
|
|
|
|
message Point {
|
|
double latitude = 1;
|
|
double longitude = 2;
|
|
}
|
|
|
|
message Waypoint {
|
|
// street name or related reference
|
|
string name = 1;
|
|
// gps point coordinates
|
|
Point location = 2;
|
|
}
|
|
|
|
message EtaRequest {
|
|
Point origin = 1;
|
|
Point destination = 2;
|
|
// type of transport e.g car, foot, bicycle
|
|
string type = 3;
|
|
// speed in kilometers
|
|
double speed = 4;
|
|
}
|
|
|
|
message EtaResponse {
|
|
// eta in seconds
|
|
double duration = 1;
|
|
}
|
|
|
|
message RouteRequest {
|
|
// Point of origin for the trip
|
|
Point origin = 1;
|
|
// Point of destination for the trip
|
|
Point destination = 2;
|
|
}
|
|
|
|
message RouteResponse {
|
|
// waypoints on the route
|
|
repeated Waypoint waypoints = 2;
|
|
}
|