Documentation
¶
Index ¶
- Variables
- func NewRoutingEndpoints() []*api.Endpoint
- func RegisterRoutingHandler(s server.Server, hdlr RoutingHandler, opts ...server.HandlerOption) error
- type Direction
- func (*Direction) Descriptor() ([]byte, []int)deprecated
- func (x *Direction) GetDistance() float64
- func (x *Direction) GetDuration() float64
- func (x *Direction) GetInstruction() string
- func (x *Direction) GetIntersections() []*Intersection
- func (x *Direction) GetManeuver() *Maneuver
- func (x *Direction) GetName() string
- func (x *Direction) GetReference() string
- func (*Direction) ProtoMessage()
- func (x *Direction) ProtoReflect() protoreflect.Message
- func (x *Direction) Reset()
- func (x *Direction) String() string
- type DirectionsRequest
- func (*DirectionsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DirectionsRequest) GetDestination() *Point
- func (x *DirectionsRequest) GetOrigin() *Point
- func (*DirectionsRequest) ProtoMessage()
- func (x *DirectionsRequest) ProtoReflect() protoreflect.Message
- func (x *DirectionsRequest) Reset()
- func (x *DirectionsRequest) String() string
- type DirectionsResponse
- func (*DirectionsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DirectionsResponse) GetDirections() []*Direction
- func (x *DirectionsResponse) GetDistance() float64
- func (x *DirectionsResponse) GetDuration() float64
- func (x *DirectionsResponse) GetWaypoints() []*Waypoint
- func (*DirectionsResponse) ProtoMessage()
- func (x *DirectionsResponse) ProtoReflect() protoreflect.Message
- func (x *DirectionsResponse) Reset()
- func (x *DirectionsResponse) String() string
- type EtaRequest
- func (*EtaRequest) Descriptor() ([]byte, []int)deprecated
- func (x *EtaRequest) GetDestination() *Point
- func (x *EtaRequest) GetOrigin() *Point
- func (x *EtaRequest) GetSpeed() float64
- func (x *EtaRequest) GetType() string
- func (*EtaRequest) ProtoMessage()
- func (x *EtaRequest) ProtoReflect() protoreflect.Message
- func (x *EtaRequest) Reset()
- func (x *EtaRequest) String() string
- type EtaResponse
- type Intersection
- func (*Intersection) Descriptor() ([]byte, []int)deprecated
- func (x *Intersection) GetBearings() []float64
- func (x *Intersection) GetLocation() *Point
- func (*Intersection) ProtoMessage()
- func (x *Intersection) ProtoReflect() protoreflect.Message
- func (x *Intersection) Reset()
- func (x *Intersection) String() string
- type Maneuver
- func (*Maneuver) Descriptor() ([]byte, []int)deprecated
- func (x *Maneuver) GetAction() string
- func (x *Maneuver) GetBearingAfter() float64
- func (x *Maneuver) GetBearingBefore() float64
- func (x *Maneuver) GetDirection() string
- func (x *Maneuver) GetLocation() *Point
- func (*Maneuver) ProtoMessage()
- func (x *Maneuver) ProtoReflect() protoreflect.Message
- func (x *Maneuver) Reset()
- func (x *Maneuver) String() string
- type Point
- type RouteRequest
- func (*RouteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RouteRequest) GetDestination() *Point
- func (x *RouteRequest) GetOrigin() *Point
- func (*RouteRequest) ProtoMessage()
- func (x *RouteRequest) ProtoReflect() protoreflect.Message
- func (x *RouteRequest) Reset()
- func (x *RouteRequest) String() string
- type RouteResponse
- func (*RouteResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RouteResponse) GetDistance() float64
- func (x *RouteResponse) GetDuration() float64
- func (x *RouteResponse) GetWaypoints() []*Waypoint
- func (*RouteResponse) ProtoMessage()
- func (x *RouteResponse) ProtoReflect() protoreflect.Message
- func (x *RouteResponse) Reset()
- func (x *RouteResponse) String() string
- type RoutingHandler
- type RoutingService
- type Waypoint
Constants ¶
This section is empty.
Variables ¶
var File_proto_routing_proto protoreflect.FileDescriptor
Functions ¶
func NewRoutingEndpoints ¶
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) GetDistance ¶
func (*Direction) GetDuration ¶
func (*Direction) GetInstruction ¶
func (*Direction) GetIntersections ¶
func (x *Direction) GetIntersections() []*Intersection
func (*Direction) GetManeuver ¶
func (*Direction) GetReference ¶
func (*Direction) ProtoMessage ¶
func (*Direction) ProtoMessage()
func (*Direction) ProtoReflect ¶
func (x *Direction) ProtoReflect() protoreflect.Message
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) GetBearingAfter ¶
func (*Maneuver) GetBearingBefore ¶
func (*Maneuver) GetDirection ¶
func (*Maneuver) GetLocation ¶
func (*Maneuver) ProtoMessage ¶
func (*Maneuver) ProtoMessage()
func (*Maneuver) ProtoReflect ¶
func (x *Maneuver) ProtoReflect() protoreflect.Message
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) GetLatitude ¶
func (*Point) GetLongitude ¶
func (*Point) ProtoMessage ¶
func (*Point) ProtoMessage()
func (*Point) ProtoReflect ¶
func (x *Point) ProtoReflect() protoreflect.Message
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) GetLocation ¶
func (*Waypoint) ProtoMessage ¶
func (*Waypoint) ProtoMessage()
func (*Waypoint) ProtoReflect ¶
func (x *Waypoint) ProtoReflect() protoreflect.Message