commands

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitSuccess      = 0
	ExitRuntimeError = 1
	ExitUsageError   = 2
)
View Source
const TokenExpiryWarning = `` /* 231-byte string literal not displayed */

TokenExpiryWarning is shown when commands require Maps API authentication

Variables

View Source
var (
	ErrInvalidCoordinateFormat  = errors.New("invalid coordinate format, expected lat,lng")
	ErrInvalidBoundingBoxFormat = errors.New("invalid bounding box format, expected north,east,south,west")
	ErrInvalidLatitude          = errors.New("latitude must be between -90 and 90")
	ErrInvalidLongitude         = errors.New("longitude must be between -180 and 180")
	ErrInvalidBoundingBox       = errors.New("invalid bounding box: north must be > south and east must be > west")
)

Functions

func AutoUpdateCheck

func AutoUpdateCheck()

AutoUpdateCheck performs an automatic background update check This is called once at startup and is non-blocking

Types

type AutocompleteResponse

type AutocompleteResponse struct {
	Results []AutocompleteResult `json:"results"`
}

AutocompleteResponse represents the top-level response from Apple Maps /v1/searchAutocomplete

type AutocompleteResult

type AutocompleteResult struct {
	DisplayLines  []string `json:"displayLines"`
	CompletionURL string   `json:"completionUrl,omitempty"`
}

AutocompleteResult represents a single autocomplete suggestion

type Command

type Command struct {
	Name      string
	UsageLine string
	Summary   string
	Usage     string
	Run       func(args []string, stdout, stderr io.Writer) int
}

func NewAuthCheckCommand

func NewAuthCheckCommand() Command

func NewAuthTokenCommand

func NewAuthTokenCommand() Command

func NewAutocompleteCommand

func NewAutocompleteCommand() Command

func NewCacheCommand

func NewCacheCommand() Command

func NewCheckUpdateCommand

func NewCheckUpdateCommand() Command

func NewConfigCommand

func NewConfigCommand() Command

func NewDirectionsCommand

func NewDirectionsCommand() Command

func NewGeocodeCommand

func NewGeocodeCommand() Command

func NewHelpCommand

func NewHelpCommand(usage func(io.Writer), lookup func(string) (Command, bool)) Command

func NewPingCommand

func NewPingCommand() Command

func NewReverseCommand

func NewReverseCommand() Command

func NewSearchCommand

func NewSearchCommand() Command

func NewSnapshotCommand

func NewSnapshotCommand() Command

func NewUnifiedCommand

func NewUnifiedCommand() Command

func NewVersionCommand

func NewVersionCommand() Command

type Coordinate

type Coordinate struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

Coordinate represents a geographic coordinate

type SearchResponse

type SearchResponse struct {
	Results []SearchResult `json:"results"`
}

SearchResponse represents the top-level response from Apple Maps /v1/search

type SearchResult

type SearchResult struct {
	Name                  string     `json:"name,omitempty"`
	FormattedAddressLines []string   `json:"formattedAddressLines,omitempty"`
	Coordinate            Coordinate `json:"coordinate"`
	PoiCategory           string     `json:"poiCategory,omitempty"`
}

SearchResult represents an individual POI or address found in the search

Jump to

Keyboard shortcuts

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