Documentation
¶
Overview ¶
Package meteo implements Go client library for the YR.no weather service API operated by Norwegian Meteorological Institute (NRK) and the Norwegian Broadcasting Corporation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBaseURL ¶
func WithBaseURL(u string) option
func WithHTTPClient ¶
func WithUserAgent ¶
func WithUserAgent(ua string) option
Types ¶
type Client ¶
type Client struct {
UserAgent string
BaseURL string
HTTPClient *http.Client
Resolve func(context.Context, string) (Location, error)
Debug io.Writer
}
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
|
|
|
meteo
command
|
|
|
examples
|
|
|
basic
command
|
|
|
concurrent
command
Example of running the program below
|
Example of running the program below |
Click to show internal directories.
Click to hide internal directories.