Documentation
¶
Overview ¶
Package openelevation exposes the Open Elevation API as a kit Domain driver. A multi-domain host (ant) enables it with a single blank import:
import _ "github.com/tamnd/open-elevation-cli/open-elevation"
The same Domain also builds the standalone elevation binary (see cli/root.go), so the binary and a host share one source of truth.
Package openelevation is the library behind the elevation command line: the HTTP client, request shaping, and the typed data models for the Open Elevation API (api.open-elevation.com).
No API key required. The API is public and free. The Client sets a real User-Agent, paces requests to stay polite, and retries transient failures (429 and 5xx).
Index ¶
Constants ¶
const Host = "api.open-elevation.com"
Host is the site this client talks to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to the Open Elevation API over HTTP.
type Config ¶
type Config struct {
BaseURL string
UserAgent string
Rate time.Duration
Timeout time.Duration
Retries int
}
Config holds all tunable parameters for the Client.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config with sensible defaults.
type Domain ¶
type Domain struct{}
Domain is the open-elevation driver.
func (Domain) Info ¶
func (Domain) Info() kit.DomainInfo
Info describes the scheme, the hostnames a pasted link is matched against, and the identity reused for the binary's help and version.