handler

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDownstream         = errors.InternalServerError("ROUTING_ERROR", "Unable to connect to routing provider")
	ErrMissingOrigin      = errors.BadRequest("MISSING_ORIGIN", "Missing origin")
	ErrMissingDestination = errors.BadRequest("MISSING_DESTINATION", "Missing destination")
	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")
)

Functions

This section is empty.

Types

type Google

type Google struct {
	Maps *maps.Client
}

func (*Google) Directions

func (r *Google) Directions(ctx context.Context, req *pb.DirectionsRequest, rsp *pb.DirectionsResponse) error

func (*Google) Eta

func (r *Google) Eta(ctx context.Context, req *pb.EtaRequest, rsp *pb.EtaResponse) error

Calculate the ETAs for a route

func (*Google) Route

func (r *Google) Route(ctx context.Context, req *pb.RouteRequest, rsp *pb.RouteResponse) error

type OSRM

type OSRM struct {
	// api address
	Address string
	// osrm client
	Client *osrm.OSRM
}

func (*OSRM) Directions

func (o *OSRM) Directions(ctx context.Context, req *pb.DirectionsRequest, rsp *pb.DirectionsResponse) error

func (*OSRM) Eta

func (o *OSRM) Eta(ctx context.Context, req *pb.EtaRequest, rsp *pb.EtaResponse) error

func (*OSRM) Route

func (o *OSRM) Route(ctx context.Context, req *pb.RouteRequest, rsp *pb.RouteResponse) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL