Documentation
¶
Index ¶
- type Client
- func (client *Client) Current(q string, optionalParams ...OptionalParam) (*CurrentWeather, error)
- func (client *Client) Forecast(q string, days int, optionalParams ...OptionalParam) (*ForecastWeather, error)
- func (client *Client) History(q string, dt string, optionalParams ...OptionalParam) (*HistoryWeather, error)
- func (client *Client) Search(q string) (*MatchingCities, error)
- type Current
- type CurrentWeather
- type Forecast
- type ForecastWeather
- type HistoryWeather
- type Location
- type MatchingCities
- type OptionalParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client describes apixu api client.
func (*Client) Current ¶
func (client *Client) Current(q string, optionalParams ...OptionalParam) (*CurrentWeather, error)
Current returns CurrentWeather obj representing current weather status.
func (*Client) Forecast ¶
func (client *Client) Forecast(q string, days int, optionalParams ...OptionalParam) (*ForecastWeather, error)
Forecast returns ForecastWeather obj representing forecast status.
func (*Client) History ¶
func (client *Client) History(q string, dt string, optionalParams ...OptionalParam) (*HistoryWeather, error)
History returns HistoryWeather obj representing history status.
type Current ¶
type Current struct {
LastUpdatedEpoch int `json:"last_updated_epoch"`
LastUpdated string `json:"last_updated"`
TempC float64 `json:"temp_c"`
TempF float64 `json:"temp_f"`
IsDay int `json:"is_day"`
Condition struct {
Text string `json:"text"`
Icon string `json:"icon"`
Code int `json:"code"`
} `json:"condition"`
WindMph float64 `json:"wind_mph"`
WindKph float64 `json:"wind_kph"`
WindDegree int `json:"wind_degree"`
WindDir string `json:"wind_dir"`
PressureMb float64 `json:"pressure_mb"`
PressureIn float64 `json:"pressure_in"`
PrecipMm float64 `json:"precip_mm"`
PrecipIn float64 `json:"precip_in"`
Humidity int `json:"humidity"`
Cloud int `json:"cloud"`
FeelslikeC float64 `json:"feelslike_c"`
FeelslikeF float64 `json:"feelslike_f"`
VisKm float64 `json:"vis_km"`
VisMiles float64 `json:"vis_miles"`
}
Current describes realtime weather information.
type CurrentWeather ¶
CurrentWeather describes data returned by current.
type Forecast ¶
type Forecast struct {
Forecastday []struct {
Date string `json:"date"`
DateEpoch int `json:"date_epoch"`
Day struct {
MaxtempC float64 `json:"maxtemp_c"`
MaxtempF float64 `json:"maxtemp_f"`
MintempC float64 `json:"mintemp_c"`
MintempF float64 `json:"mintemp_f"`
AvgtempC float64 `json:"avgtemp_c"`
AvgtempF float64 `json:"avgtemp_f"`
MaxwindMph float64 `json:"maxwind_mph"`
MaxwindKph float64 `json:"maxwind_kph"`
TotalprecipMm float64 `json:"totalprecip_mm"`
TotalprecipIn float64 `json:"totalprecip_in"`
AvgvisKm float64 `json:"avgvis_km"`
AvgvisMiles float64 `json:"avgvis_miles"`
Avghumidity float64 `json:"avghumidity"`
Condition struct {
Text string `json:"text"`
Icon string `json:"icon"`
Code int `json:"code"`
} `json:"condition"`
Uv float64 `json:"uv"`
} `json:"day"`
Astro struct {
Sunrise string `json:"sunrise"`
Sunset string `json:"sunset"`
Moonrise string `json:"moonrise"`
Moonset string `json:"moonset"`
} `json:"astro"`
Hour []struct {
TimeEpoch int `json:"time_epoch"`
Time string `json:"time"`
TempC float64 `json:"temp_c"`
TempF float64 `json:"temp_f"`
IsDay int `json:"is_day"`
Condition struct {
Text string `json:"text"`
Icon string `json:"icon"`
Code int `json:"code"`
} `json:"condition"`
WindMph float64 `json:"wind_mph"`
WindKph float64 `json:"wind_kph"`
WindDegree int `json:"wind_degree"`
WindDir string `json:"wind_dir"`
PressureMb float64 `json:"pressure_mb"`
PressureIn float64 `json:"pressure_in"`
PrecipMm float64 `json:"precip_mm"`
PrecipIn float64 `json:"precip_in"`
Humidity int `json:"humidity"`
Cloud int `json:"cloud"`
FeelslikeC float64 `json:"feelslike_c"`
FeelslikeF float64 `json:"feelslike_f"`
WindchillC float64 `json:"windchill_c"`
WindchillF float64 `json:"windchill_f"`
HeatindexC float64 `json:"heatindex_c"`
HeatindexF float64 `json:"heatindex_f"`
DewpointC float64 `json:"dewpoint_c"`
DewpointF float64 `json:"dewpoint_f"`
WillItRain int `json:"will_it_rain"`
ChanceOfRain string `json:"chance_of_rain"`
WillItSnow int `json:"will_it_snow"`
ChanceOfSnow string `json:"chance_of_snow"`
VisKm float64 `json:"vis_km"`
VisMiles float64 `json:"vis_miles"`
} `json:"hour"`
} `json:"forecastday"`
}
Forecast describes astronomy data.
type ForecastWeather ¶
type ForecastWeather struct {
Location Location `json:"location"`
Current Current `json:"current"`
Forecast Forecast `json:"forecast"`
}
ForecastWeather describes data returned by forecast.
type HistoryWeather ¶
type HistoryWeather struct {
Location Location `json:"location"`
Forecast Forecast `json:"forecast"`
}
HistoryWeather describes data returned by history.
type Location ¶
type Location struct {
Name string `json:"name"`
Region string `json:"region"`
Country string `json:"country"`
Lat float64 `json:"lat"`
Lon float64 `json:"lon"`
TzID string `json:"tz_id"`
LocaltimeEpoch int `json:"localtime_epoch"`
Localtime string `json:"localtime"`
}
Location describes essential data of the matched location.
type MatchingCities ¶
type MatchingCities []struct {
ID int `json:"id"`
Name string `json:"name"`
Region string `json:"region"`
Country string `json:"country"`
Lat float64 `json:"lat"`
Lon float64 `json:"lon"`
URL string `json:"url"`
}
MatchingCities describes data returned by search.
type OptionalParam ¶
OptionalParam describes optional query parameters used in client methods.