Documentation ¶
Overview ¶
Package meteo is a client library for the weather APIs.
Index ¶
- func RunForecastCLI() int
- func RunWeatherCLI() int
- func WithBaseURL(u string) option
- func WithHTTPClient(hc *http.Client) option
- func WithResolver(rs func(context.Context, string) (Location, error)) option
- func WithUserAgent(ua string) option
- type Client
- type CurrentWeather
- type Forecast
- type HourlyForecast
- type Location
- type Weather
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunForecastCLI ¶
func RunForecastCLI() int
func RunWeatherCLI ¶
func RunWeatherCLI() int
RunCLI is a main function that runs the cli machinery.
func WithBaseURL ¶
func WithBaseURL(u string) option
func WithHTTPClient ¶
func WithUserAgent ¶
func WithUserAgent(ua string) option
Types ¶
type Client ¶
type Client struct { BaseURL string HTTPClient *http.Client Resolve func(context.Context, string) (Location, error) Debug io.Writer // contains filtered or unexported fields }
Client represents a weather client for the Norwegian Meteorological Institute.
func (*Client) GetWeather ¶
GetWeather returns current weather for given place.
Place string should have format: "<place-name>,<country-code>", for example: "London,UK", "Dublin,IE", "Paris,FR", "Warsaw,PL".
type CurrentWeather ¶
type Forecast ¶
type Forecast struct { UpdatedAt time.Time Hourly []HourlyForecast }
type HourlyForecast ¶
type HourlyForecast struct { Time time.Time AirPressure float64 // in hPa AirTemperature float64 // in Celsius CloudAreaFraction float64 // in "%"" RelativeHumidity float64 // in "%" WindFromDirection float64 // in "degrees" WindSpeed float64 // in "m/s" PrecipitationAmount float64 // in "mm" Summary string }
type Weather ¶
Weather represents weather conditions in a geographical region.
func GetWeather ¶
GetWeather returns current weather for given place and country using default client.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
examples
|
|
concurrent
Example of running the program below
|
Example of running the program below |
Click to show internal directories.
Click to hide internal directories.