Documentation
¶
Overview ¶
Package floodmeteo is the library behind the floodmeteo command line: the HTTP client, request shaping, and the typed data models for the Open-Meteo Flood API (river discharge forecasts).
The Client here is the spine every command shares. It sets a real User-Agent, paces requests so a busy session stays polite, and retries the transient failures (429 and 5xx) that any public API throws under load.
Index ¶
Constants ¶
const DefaultUserAgent = "floodmeteo/dev (+https://github.com/tamnd/floodmeteo-cli)"
DefaultUserAgent identifies the client to Open-Meteo.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client talks to the Open-Meteo Flood API over HTTPS.
func NewClientFromConfig ¶
NewClientFromConfig builds a Client from the provided Config.
type DailyDischarge ¶
type DailyDischarge struct {
Time string `json:"time" kit:"id"`
RiverDischarge float64 `json:"river_discharge"`
}
DailyDischarge is one day of river discharge forecast data.
type Domain ¶
type Domain struct{}
Domain is the floodmeteo driver.
func (Domain) Classify ¶
Classify turns any accepted input into the canonical (type, id). A lat,lon pair is classified as "latlon"; anything else as "query".
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.