WeatherService/src/client/WeatherStruct.go

69 lines
2.0 KiB
Go

package client
type WeatherResponse struct {
Coordinates Coordinates `json:"coord,omitempty"`
Weather []Weather `json:"weather,omitempty"`
Base string `json:"base,omitempty"`
Main Main `json:"main,omitempty"`
Visibility int `json:"visibility,omitempty"`
Wind Wind `json:"wind,omitempty"`
Clouds Clouds `json:"clouds,omitempty"`
Rain Rain `json:"rain,omitempty"`
Snow Snow `json:"snow,omitempty"`
Date int `json:"dt,omitempty"`
System System `json:"sys,omitempty"`
Timezone int `json:"timezone,omitempty"`
Id int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Cod int `json:"cod,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 Coordinates struct {
Longitude float32 `json:"lon,omitempty"`
Latitude float32 `json:"lat,omitempty"`
}
type Main struct {
Temperature float32 `json:"temp,omitempty"`
FeelsLike float32 `json:"feels_like,omitempty"`
TemperatureMin float32 `json:"temp_min,omitempty"`
TemperatureMax float32 `json:"temp_max,omitempty"`
Pressure int `json:"pressure,omitempty"`
Humidity int `json:"humidity,omitempty"`
}
type Wind struct {
Speed float32 `json:"speed,omitempty"`
Degree int `json:"deg,omitempty"`
}
type Clouds struct {
All int `json:"all,omitempty"`
}
type Rain struct {
OneHour int `json:",omitempty"`
ThreeHours int `json:"3h,omitempty"`
}
type Snow struct {
OneHour float32 `json:"1h,omitempty"`
ThreeHours float32 `json:"3h,omitempty"`
}
type System struct {
Type int `json:",omitempty"`
Id int `json:"id,omitempty"`
Message float32 `json:"message,omitempty"`
Country string `json:"country,omitempty"`
Sunrise int `json:"sunrise,omitempty"`
Sunset int `json:"sunset,omitempty"`
}