Documentation ¶
Overview ¶
Package geo provides the ability to calculate duration between two locations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // did not return an error, but an unexpected response was received. ErrUnavailable = errors.New("duration unavailable") // ErrBadLocation is returned in cases where either the 'from' or 'to' address // could not be found. ErrBadLocation = errors.New("failed to find one of the provided locations") )
View Source
var ( // Drive indicates a driving TravelMode. Drive = TravelMode(maps.TravelModeDriving) // Walk indicates a walking TravelMode. Walk = TravelMode(maps.TravelModeWalking) // Bike indicates a Biking TravelMode. Bike = TravelMode(maps.TravelModeBicycling) // Transit indicates public transit as a TravelMode. Transit = TravelMode(maps.TravelModeTransit) )
Functions ¶
This section is empty.
Types ¶
type Communicator ¶
type Communicator interface {
DistanceMatrix(context.Context, *maps.DistanceMatrixRequest) (*maps.DistanceMatrixResponse, error)
}
Communicator defines a type that can make requests to the Google Maps API.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router provides the ability to calculate travel duration between Routes.
func (Router) CurrentLocation ¶
CurrentLocation attempts to use Geolocation to return the Lat/Long of the system device based on it's IP Address.
type TravelMode ¶
TravelMode dictates the type of travel when determining the duration.
func (TravelMode) String ¶
func (t TravelMode) String() string
String returns a user friendly string representation of a TravelMode.
Click to show internal directories.
Click to hide internal directories.