add eta method to routing service

This commit is contained in:
Asim Aslam
2021-04-26 16:03:21 +01:00
parent 334336ca6f
commit 4390fdad76
5 changed files with 318 additions and 73 deletions

View File

@@ -18,12 +18,18 @@ var (
ErrMissingLatitude = errors.BadRequest("MISSING_LATITUDE", "Missing latitude")
ErrMissingLongitude = errors.BadRequest("MISSING_LONGITUDE", "Missing longitude")
ErrNoRoutes = errors.BadRequest("NO_ROUTES", "No routes found")
ErrUnimplemented = errors.InternalServerError("UNIMPLEMENTED", "endpoint is unimplemented")
)
type Google struct {
Maps *maps.Client
}
func (r *Google) ETA(ctx context.Context, req *pb.ETARequest, rsp *pb.ETAResponse) error {
// TODO: implement eta
return ErrUnimplemented
}
func (r *Google) Route(ctx context.Context, req *pb.RouteRequest, rsp *pb.RouteResponse) error {
// validate the request
if req.Origin == nil {