libvalhalla-go/valhalla.go

53 lines
1.4 KiB
Go
Raw Normal View History

2024-12-30 10:51:25 +00:00
package valhalla
2024-12-30 16:16:47 +00:00
type ValhallaHandler struct {
Actor *Actor
2024-12-30 10:51:25 +00:00
}
2024-12-30 16:16:47 +00:00
func NewValhallaHandler() (*ValhallaHandler, error) {
actor, err := NewActorFromConfig(DefaultConfig())
if err != nil {
return nil, err
2024-12-30 10:51:25 +00:00
}
2024-12-30 16:16:47 +00:00
return &ValhallaHandler{
Actor: actor,
}, nil
2024-12-30 10:51:25 +00:00
}
2024-12-30 16:16:47 +00:00
func (h *ValhallaHandler) Route(input ValhallaRouteInput) (*ValhallaRouteResponse, error) {
return nil, nil
2024-12-30 10:51:25 +00:00
}
2024-12-30 16:16:47 +00:00
type ValhallaRouteInput struct {
Locations []ValhallaLocation `json:"locations"`
Costing *string `json:"costing,omitempty"`
CostingOptions *ValhallaCostingOptions `json:"costing_options,omitempty"`
Language *string `json:"language,omitempty"`
2024-12-30 10:51:25 +00:00
}
2024-12-30 16:16:47 +00:00
type ValhallaRouteResponse struct{}
2024-12-30 10:51:25 +00:00
2024-12-30 16:16:47 +00:00
type ValhallaLocation struct {
Lat float64 `json:"lat"`
Lon float64 `json:"lon"`
Type *string `json:"type,omitempty"`
Heading *string `json:"heading,omitempty"`
HeadingTolerance *string `json:"heading_tolerance,omitempty"`
Street *string `json:"street,omitempty"`
Radius *int64 `json:"radius,omitempty"`
RankCandidates *bool `json:"rank_candidates,omitempty"`
PreferedSide *string `json:"prefered_side"`
// DisplayLat
// DisplayLon
// SearchCutoff
// NodeSnapTolerance
// StreetSideTolerance
// StreetSideMaxDistance
// StreetSideCutoff
// SearchFilters
// PreferredLayer
2024-12-30 10:51:25 +00:00
}
2024-12-30 16:16:47 +00:00
type ValhallaCostingOptions struct{}