valhalla

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Leg

type Leg struct {
	Shape     string     `json:"shape"`
	Maneuvers []Maneuver `json:"maneuvers"`
	Summary   Summary    `json:"summary"`
}

type Maneuver

type Maneuver struct {
	Length          float64 `json:"length"`
	Time            float64 `json:"time"`
	TravelMode      string  `json:"travel_mode"`
	Instruction     string  `json:"instruction"`
	BeginShapeIndex int     `json:"begin_shape_index"`
}

type Request

type Request struct {
	Locations []RequestLocation `json:"locations"`
	Costing   string            `json:"costing"`
}

type RequestLocation

type RequestLocation struct {
	Lat float64 `json:"lat"`
	Lon float64 `json:"lon"`
}

type Response

type Response struct {
	Trip  Trip   `json:"trip"`
	Units string `json:"units"`
}

type Router

type Router struct {
	Clock clock.Clock
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(client *http.Client, endpoint string, apikey string) *Router

func (*Router) Request

func (h *Router) Request(ctx context.Context, req model.DirectionRequest) (*model.Directions, error)

type Summary

type Summary struct {
	Time   float64 `json:"time"`
	Length float64 `json:"length"`
}

type Trip

type Trip struct {
	Legs      []Leg             `json:"legs"`
	Summary   Summary           `json:"summary"`
	Locations []RequestLocation `json:"locations"`
}

Jump to

Keyboard shortcuts

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