routing

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_routing_proto protoreflect.FileDescriptor

Functions

func NewRoutingEndpoints

func NewRoutingEndpoints() []*api.Endpoint

func RegisterRoutingHandler

func RegisterRoutingHandler(s server.Server, hdlr RoutingHandler, opts ...server.HandlerOption) error

Types

type Direction

type Direction struct {

	// street name or location
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// alternative reference
	Reference string `protobuf:"bytes,2,opt,name=reference,proto3" json:"reference,omitempty"`
	// human readable instruction
	Instruction string `protobuf:"bytes,3,opt,name=instruction,proto3" json:"instruction,omitempty"`
	// distance to travel in meters
	Distance float64 `protobuf:"fixed64,4,opt,name=distance,proto3" json:"distance,omitempty"`
	// duration to travel in seconds
	Duration float64 `protobuf:"fixed64,5,opt,name=duration,proto3" json:"duration,omitempty"`
	// maneuver to take
	Maneuver *Maneuver `protobuf:"bytes,6,opt,name=maneuver,proto3" json:"maneuver,omitempty"`
	// intersections on route
	Intersections []*Intersection `protobuf:"bytes,7,rep,name=intersections,proto3" json:"intersections,omitempty"`
	// contains filtered or unexported fields
}

func (*Direction) Descriptor deprecated

func (*Direction) Descriptor() ([]byte, []int)

Deprecated: Use Direction.ProtoReflect.Descriptor instead.

func (*Direction) GetDistance

func (x *Direction) GetDistance() float64

func (*Direction) GetDuration

func (x *Direction) GetDuration() float64

func (*Direction) GetInstruction

func (x *Direction) GetInstruction() string

func (*Direction) GetIntersections

func (x *Direction) GetIntersections() []*Intersection

func (*Direction) GetManeuver

func (x *Direction) GetManeuver() *Maneuver

func (*Direction) GetName

func (x *Direction) GetName() string

func (*Direction) GetReference

func (x *Direction) GetReference() string

func (*Direction) ProtoMessage

func (*Direction) ProtoMessage()

func (*Direction) ProtoReflect

func (x *Direction) ProtoReflect() protoreflect.Message

func (*Direction) Reset

func (x *Direction) Reset()

func (*Direction) String

func (x *Direction) String() string

type DirectionsRequest

type DirectionsRequest struct {

	// The staring point for the journey
	Origin *Point `protobuf:"bytes,1,opt,name=origin,proto3" json:"origin,omitempty"`
	// The destinationg of the journey
	Destination *Point `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"`
	// contains filtered or unexported fields
}

Turn by turn directions from a starting and endpoint including maneuvers and bearings

func (*DirectionsRequest) Descriptor deprecated

func (*DirectionsRequest) Descriptor() ([]byte, []int)

Deprecated: Use DirectionsRequest.ProtoReflect.Descriptor instead.

func (*DirectionsRequest) GetDestination

func (x *DirectionsRequest) GetDestination() *Point

func (*DirectionsRequest) GetOrigin

func (x *DirectionsRequest) GetOrigin() *Point

func (*DirectionsRequest) ProtoMessage

func (*DirectionsRequest) ProtoMessage()

func (*DirectionsRequest) ProtoReflect

func (x *DirectionsRequest) ProtoReflect() protoreflect.Message

func (*DirectionsRequest) Reset

func (x *DirectionsRequest) Reset()

func (*DirectionsRequest) String

func (x *DirectionsRequest) String() string

type DirectionsResponse

type DirectionsResponse struct {

	// Turn by turn directions
	Directions []*Direction `protobuf:"bytes,1,rep,name=directions,proto3" json:"directions,omitempty"`
	// The waypoints on the route
	Waypoints []*Waypoint `protobuf:"bytes,2,rep,name=waypoints,proto3" json:"waypoints,omitempty"`
	// Estimated distance of the route in meters
	Distance float64 `protobuf:"fixed64,3,opt,name=distance,proto3" json:"distance,omitempty"`
	// Estimated duration of the route in seconds
	Duration float64 `protobuf:"fixed64,4,opt,name=duration,proto3" json:"duration,omitempty"`
	// contains filtered or unexported fields
}

func (*DirectionsResponse) Descriptor deprecated

func (*DirectionsResponse) Descriptor() ([]byte, []int)

Deprecated: Use DirectionsResponse.ProtoReflect.Descriptor instead.

func (*DirectionsResponse) GetDirections

func (x *DirectionsResponse) GetDirections() []*Direction

func (*DirectionsResponse) GetDistance

func (x *DirectionsResponse) GetDistance() float64

func (*DirectionsResponse) GetDuration

func (x *DirectionsResponse) GetDuration() float64

func (*DirectionsResponse) GetWaypoints

func (x *DirectionsResponse) GetWaypoints() []*Waypoint

func (*DirectionsResponse) ProtoMessage

func (*DirectionsResponse) ProtoMessage()

func (*DirectionsResponse) ProtoReflect

func (x *DirectionsResponse) ProtoReflect() protoreflect.Message

func (*DirectionsResponse) Reset

func (x *DirectionsResponse) Reset()

func (*DirectionsResponse) String

func (x *DirectionsResponse) String() string

type EtaRequest

type EtaRequest struct {

	// The starting point for the eta calculation
	Origin *Point `protobuf:"bytes,1,opt,name=origin,proto3" json:"origin,omitempty"`
	// The end point for the eta calculation
	Destination *Point `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"`
	// type of transport e.g car, foot, bicycle
	Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	// speed in kilometers
	Speed float64 `protobuf:"fixed64,4,opt,name=speed,proto3" json:"speed,omitempty"`
	// contains filtered or unexported fields
}

Get the eta for a route from origin to destination. The eta is an estimated time based on car routes

func (*EtaRequest) Descriptor deprecated

func (*EtaRequest) Descriptor() ([]byte, []int)

Deprecated: Use EtaRequest.ProtoReflect.Descriptor instead.

func (*EtaRequest) GetDestination

func (x *EtaRequest) GetDestination() *Point

func (*EtaRequest) GetOrigin

func (x *EtaRequest) GetOrigin() *Point

func (*EtaRequest) GetSpeed

func (x *EtaRequest) GetSpeed() float64

func (*EtaRequest) GetType

func (x *EtaRequest) GetType() string

func (*EtaRequest) ProtoMessage

func (*EtaRequest) ProtoMessage()

func (*EtaRequest) ProtoReflect

func (x *EtaRequest) ProtoReflect() protoreflect.Message

func (*EtaRequest) Reset

func (x *EtaRequest) Reset()

func (*EtaRequest) String

func (x *EtaRequest) String() string

type EtaResponse

type EtaResponse struct {

	// eta in seconds
	Duration float64 `protobuf:"fixed64,1,opt,name=duration,proto3" json:"duration,omitempty"`
	// contains filtered or unexported fields
}

func (*EtaResponse) Descriptor deprecated

func (*EtaResponse) Descriptor() ([]byte, []int)

Deprecated: Use EtaResponse.ProtoReflect.Descriptor instead.

func (*EtaResponse) GetDuration

func (x *EtaResponse) GetDuration() float64

func (*EtaResponse) ProtoMessage

func (*EtaResponse) ProtoMessage()

func (*EtaResponse) ProtoReflect

func (x *EtaResponse) ProtoReflect() protoreflect.Message

func (*EtaResponse) Reset

func (x *EtaResponse) Reset()

func (*EtaResponse) String

func (x *EtaResponse) String() string

type Intersection

type Intersection struct {
	Location *Point    `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"`
	Bearings []float64 `protobuf:"fixed64,2,rep,packed,name=bearings,proto3" json:"bearings,omitempty"`
	// contains filtered or unexported fields
}

func (*Intersection) Descriptor deprecated

func (*Intersection) Descriptor() ([]byte, []int)

Deprecated: Use Intersection.ProtoReflect.Descriptor instead.

func (*Intersection) GetBearings

func (x *Intersection) GetBearings() []float64

func (*Intersection) GetLocation

func (x *Intersection) GetLocation() *Point

func (*Intersection) ProtoMessage

func (*Intersection) ProtoMessage()

func (*Intersection) ProtoReflect

func (x *Intersection) ProtoReflect() protoreflect.Message

func (*Intersection) Reset

func (x *Intersection) Reset()

func (*Intersection) String

func (x *Intersection) String() string

type Maneuver

type Maneuver struct {
	BearingBefore float64 `protobuf:"fixed64,1,opt,name=bearing_before,json=bearingBefore,proto3" json:"bearing_before,omitempty"`
	BearingAfter  float64 `protobuf:"fixed64,2,opt,name=bearing_after,json=bearingAfter,proto3" json:"bearing_after,omitempty"`
	Location      *Point  `protobuf:"bytes,3,opt,name=location,proto3" json:"location,omitempty"`
	Action        string  `protobuf:"bytes,4,opt,name=action,proto3" json:"action,omitempty"`
	Direction     string  `protobuf:"bytes,5,opt,name=direction,proto3" json:"direction,omitempty"`
	// contains filtered or unexported fields
}

func (*Maneuver) Descriptor deprecated

func (*Maneuver) Descriptor() ([]byte, []int)

Deprecated: Use Maneuver.ProtoReflect.Descriptor instead.

func (*Maneuver) GetAction

func (x *Maneuver) GetAction() string

func (*Maneuver) GetBearingAfter

func (x *Maneuver) GetBearingAfter() float64

func (*Maneuver) GetBearingBefore

func (x *Maneuver) GetBearingBefore() float64

func (*Maneuver) GetDirection

func (x *Maneuver) GetDirection() string

func (*Maneuver) GetLocation

func (x *Maneuver) GetLocation() *Point

func (*Maneuver) ProtoMessage

func (*Maneuver) ProtoMessage()

func (*Maneuver) ProtoReflect

func (x *Maneuver) ProtoReflect() protoreflect.Message

func (*Maneuver) Reset

func (x *Maneuver) Reset()

func (*Maneuver) String

func (x *Maneuver) String() string

type Point

type Point struct {

	// Lat e.g 52.523219
	Latitude float64 `protobuf:"fixed64,1,opt,name=latitude,proto3" json:"latitude,omitempty"`
	// Long e.g 13.428555
	Longitude float64 `protobuf:"fixed64,2,opt,name=longitude,proto3" json:"longitude,omitempty"`
	// contains filtered or unexported fields
}

func (*Point) Descriptor deprecated

func (*Point) Descriptor() ([]byte, []int)

Deprecated: Use Point.ProtoReflect.Descriptor instead.

func (*Point) GetLatitude

func (x *Point) GetLatitude() float64

func (*Point) GetLongitude

func (x *Point) GetLongitude() float64

func (*Point) ProtoMessage

func (*Point) ProtoMessage()

func (*Point) ProtoReflect

func (x *Point) ProtoReflect() protoreflect.Message

func (*Point) Reset

func (x *Point) Reset()

func (*Point) String

func (x *Point) String() string

type RouteRequest

type RouteRequest struct {

	// Point of origin for the trip
	Origin *Point `protobuf:"bytes,1,opt,name=origin,proto3" json:"origin,omitempty"`
	// Point of destination for the trip
	Destination *Point `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"`
	// contains filtered or unexported fields
}

Retrieve a route as a simple list of gps points along with total distance and estimated duration

func (*RouteRequest) Descriptor deprecated

func (*RouteRequest) Descriptor() ([]byte, []int)

Deprecated: Use RouteRequest.ProtoReflect.Descriptor instead.

func (*RouteRequest) GetDestination

func (x *RouteRequest) GetDestination() *Point

func (*RouteRequest) GetOrigin

func (x *RouteRequest) GetOrigin() *Point

func (*RouteRequest) ProtoMessage

func (*RouteRequest) ProtoMessage()

func (*RouteRequest) ProtoReflect

func (x *RouteRequest) ProtoReflect() protoreflect.Message

func (*RouteRequest) Reset

func (x *RouteRequest) Reset()

func (*RouteRequest) String

func (x *RouteRequest) String() string

type RouteResponse

type RouteResponse struct {

	// estimated distance in meters
	Distance float64 `protobuf:"fixed64,1,opt,name=distance,proto3" json:"distance,omitempty"`
	// estimated duration in seconds
	Duration float64 `protobuf:"fixed64,2,opt,name=duration,proto3" json:"duration,omitempty"`
	// waypoints on the route
	Waypoints []*Waypoint `protobuf:"bytes,3,rep,name=waypoints,proto3" json:"waypoints,omitempty"`
	// contains filtered or unexported fields
}

func (*RouteResponse) Descriptor deprecated

func (*RouteResponse) Descriptor() ([]byte, []int)

Deprecated: Use RouteResponse.ProtoReflect.Descriptor instead.

func (*RouteResponse) GetDistance

func (x *RouteResponse) GetDistance() float64

func (*RouteResponse) GetDuration

func (x *RouteResponse) GetDuration() float64

func (*RouteResponse) GetWaypoints

func (x *RouteResponse) GetWaypoints() []*Waypoint

func (*RouteResponse) ProtoMessage

func (*RouteResponse) ProtoMessage()

func (*RouteResponse) ProtoReflect

func (x *RouteResponse) ProtoReflect() protoreflect.Message

func (*RouteResponse) Reset

func (x *RouteResponse) Reset()

func (*RouteResponse) String

func (x *RouteResponse) String() string

type RoutingHandler

type RoutingHandler interface {
	// Route returns a gps route from origin to destination based on lat/lng
	Route(context.Context, *RouteRequest, *RouteResponse) error
	// Eta returns an estimated time of arrival for a route
	Eta(context.Context, *EtaRequest, *EtaResponse) error
	// Directions provides turn by turn directions
	Directions(context.Context, *DirectionsRequest, *DirectionsResponse) error
}

type RoutingService

type RoutingService interface {
	// Route returns a gps route from origin to destination based on lat/lng
	Route(ctx context.Context, in *RouteRequest, opts ...client.CallOption) (*RouteResponse, error)
	// Eta returns an estimated time of arrival for a route
	Eta(ctx context.Context, in *EtaRequest, opts ...client.CallOption) (*EtaResponse, error)
	// Directions provides turn by turn directions
	Directions(ctx context.Context, in *DirectionsRequest, opts ...client.CallOption) (*DirectionsResponse, error)
}

func NewRoutingService

func NewRoutingService(name string, c client.Client) RoutingService

type Waypoint

type Waypoint struct {

	// street name or related reference
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// gps point coordinates
	Location *Point `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"`
	// contains filtered or unexported fields
}

func (*Waypoint) Descriptor deprecated

func (*Waypoint) Descriptor() ([]byte, []int)

Deprecated: Use Waypoint.ProtoReflect.Descriptor instead.

func (*Waypoint) GetLocation

func (x *Waypoint) GetLocation() *Point

func (*Waypoint) GetName

func (x *Waypoint) GetName() string

func (*Waypoint) ProtoMessage

func (*Waypoint) ProtoMessage()

func (*Waypoint) ProtoReflect

func (x *Waypoint) ProtoReflect() protoreflect.Message

func (*Waypoint) Reset

func (x *Waypoint) Reset()

func (*Waypoint) String

func (x *Waypoint) String() string

Jump to

Keyboard shortcuts

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