88 lines
3.7 KiB
Go
88 lines
3.7 KiB
Go
package client
|
|
|
|
type WeatherResponse struct {
|
|
Latitude float32 `json:"lat,omitempty"`
|
|
Longitude float32 `json:"lon,omitempty"`
|
|
Timezone string `json:"timezone,omitempty"`
|
|
TimezoneOffset int `json:"timezone_offset,omitempty"`
|
|
Current WeatherForecast `json:"current,omitempty"`
|
|
Minutely []Minutely `json:"minutely,omitempty"`
|
|
Hourly []WeatherForecast `json:"hourly,omitempty"`
|
|
Daily []DailyForecast `json:"daily,omitempty"`
|
|
Alerts []Alerts `json:"alerts,omitempty"`
|
|
}
|
|
|
|
type WeatherForecast struct {
|
|
Date int64 `json:"dt,omitempty"`
|
|
Sunrise int64 `json:"sunrise,omitempty"`
|
|
Sunset int64 `json:"sunset,omitempty"`
|
|
Temperature float32 `json:"temp,omitempty"`
|
|
FeelsLike float32 `json:"feels_like,omitempty"`
|
|
Pressure int `json:"pressure,omitempty"`
|
|
Humidity int `json:"humidity,omitempty"`
|
|
DewPoint float32 `json:"dew_point,omitempty"`
|
|
UVI float32 `json:"uvi,omitempty"`
|
|
Clouds int `json:"clouds,omitempty"`
|
|
Visibility int `json:"visibility,omitempty"`
|
|
WindSpeed float32 `json:"wind_speed,omitempty"`
|
|
WindDegree int `json:"wind_degree,omitempty"`
|
|
WindGust float32 `json:"wind_gust,omitempty"`
|
|
Weather []Weather `json:"weather,omitempty"`
|
|
PossibilityOfPrecipitation float32 `json:"pop,omitempty"`
|
|
}
|
|
|
|
type Weather struct {
|
|
ID int `json:"id,omitempty"`
|
|
Main string `json:"main,omitempty"`
|
|
Description string `json:"description,omitempty"`
|
|
Icon string `json:"icon,omitempty"`
|
|
}
|
|
|
|
type Minutely struct {
|
|
Date int64 `json:"dt,omitempty"`
|
|
Precipitation float32 `json:"precipitation,omitempty"`
|
|
}
|
|
|
|
type DailyForecast struct {
|
|
Date int64 `json:"dt,omitempty"`
|
|
Sunrise int64 `json:"sunrise,omitempty"`
|
|
Sunset int64 `json:"sunset,omitempty"`
|
|
Temperature Temp `json:"temp,omitempty"`
|
|
FeelsLike FeelsLike `json:"feels_like,omitempty"`
|
|
Pressure int `json:"pressure,omitempty"`
|
|
Humidity int `json:"humidity,omitempty"`
|
|
DewPoint float32 `json:"dew_point,omitempty"`
|
|
UVI float32 `json:"uvi,omitempty"`
|
|
Clouds int `json:"clouds,omitempty"`
|
|
Visibility int `json:"visibility,omitempty"`
|
|
WindSpeed float32 `json:"wind_speed,omitempty"`
|
|
WindDegree int `json:"wind_degree,omitempty"`
|
|
WindGust float32 `json:"wind_gust,omitempty"`
|
|
Weather []Weather `json:"weather,omitempty"`
|
|
PossibilityOfPrecipitation float32 `json:"pop,omitempty"`
|
|
}
|
|
|
|
type Temp struct {
|
|
Day float32 `json:"day,omitempty"`
|
|
Min float32 `json:"min,omitempty"`
|
|
Max float32 `json:"max,omitempty"`
|
|
Night float32 `json:"night,omitempty"`
|
|
Eve float32 `json:"eve,omitempty"`
|
|
Morning float32 `json:"morn,omitempty"`
|
|
}
|
|
|
|
type FeelsLike struct {
|
|
Day float32 `json:"day,omitempty"`
|
|
Night float32 `json:"night,omitempty"`
|
|
Eve float32 `json:"eve,omitempty"`
|
|
Morning float32 `json:"morn,omitempty"`
|
|
}
|
|
|
|
type Alerts struct {
|
|
Sender string `json:"sender_name,omitempty"`
|
|
Event string `json:"event,omitempty"`
|
|
Start int64 `json:"start,omitempty"`
|
|
End int64 `json:"end,omitempty"`
|
|
Description string `json:"description,omitempty"`
|
|
}
|