updated some logic and better error handling
This commit is contained in:
115
interfaces/interfaces.go
Normal file
115
interfaces/interfaces.go
Normal file
@@ -0,0 +1,115 @@
|
||||
package interfaces
|
||||
|
||||
type Urls struct {
|
||||
Url string
|
||||
Url_forecast string
|
||||
}
|
||||
|
||||
type GeoLocation struct {
|
||||
Accuracy float64 `json:"accuracy"`
|
||||
Location struct {
|
||||
Lat float64 `json:"lat"`
|
||||
Lon float64 `json:"lng"`
|
||||
} `json:"location"`
|
||||
}
|
||||
|
||||
type Forecast struct {
|
||||
Cod string `json:"cod"`
|
||||
Message int `json:"message"`
|
||||
Cnt int `json:"cnt"`
|
||||
List []struct {
|
||||
Dt int `json:"dt"`
|
||||
Main struct {
|
||||
Temp float64 `json:"temp"`
|
||||
FeelsLike float64 `json:"feels_like"`
|
||||
TempMin float64 `json:"temp_min"`
|
||||
TempMax float64 `json:"temp_max"`
|
||||
Pressure int `json:"pressure"`
|
||||
SeaLevel int `json:"sea_level"`
|
||||
GrndLevel int `json:"grnd_level"`
|
||||
Humidity int `json:"humidity"`
|
||||
TempKf float64 `json:"temp_kf"`
|
||||
} `json:"main"`
|
||||
Weather []struct {
|
||||
ID int `json:"id"`
|
||||
Main string `json:"main"`
|
||||
Description string `json:"description"`
|
||||
Icon string `json:"icon"`
|
||||
} `json:"weather"`
|
||||
Clouds struct {
|
||||
All int `json:"all"`
|
||||
} `json:"clouds"`
|
||||
Wind struct {
|
||||
Speed float64 `json:"speed"`
|
||||
Deg int `json:"deg"`
|
||||
Gust float64 `json:"gust"`
|
||||
} `json:"wind"`
|
||||
Visibility int `json:"visibility"`
|
||||
Pop float64 `json:"pop"`
|
||||
Rain struct {
|
||||
ThreeH float64 `json:"3h"`
|
||||
} `json:"rain,omitempty"`
|
||||
Sys struct {
|
||||
Pod string `json:"pod"`
|
||||
} `json:"sys"`
|
||||
DtTxt string `json:"dt_txt"`
|
||||
Snow struct {
|
||||
ThreeH float64 `json:"3h"`
|
||||
} `json:"snow,omitempty"`
|
||||
} `json:"list"`
|
||||
City struct {
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Coord struct {
|
||||
Lat float64 `json:"lat"`
|
||||
Lon float64 `json:"lon"`
|
||||
} `json:"coord"`
|
||||
Country string `json:"country"`
|
||||
Population int `json:"population"`
|
||||
Timezone int `json:"timezone"`
|
||||
Sunrise int `json:"sunrise"`
|
||||
Sunset int `json:"sunset"`
|
||||
} `json:"city"`
|
||||
}
|
||||
|
||||
type Weather struct {
|
||||
Coord struct {
|
||||
Lon float64 `json:"lon"`
|
||||
Lat float64 `json:"lat"`
|
||||
} `json:"coord"`
|
||||
Weather []struct {
|
||||
ID int `json:"id"`
|
||||
Main string `json:"main"`
|
||||
Description string `json:"description"`
|
||||
Icon string `json:"icon"`
|
||||
} `json:"weather"`
|
||||
Base string `json:"base"`
|
||||
Main struct {
|
||||
Temp float64 `json:"temp"`
|
||||
FeelsLike float64 `json:"feels_like"`
|
||||
TempMin float64 `json:"temp_min"`
|
||||
TempMax float64 `json:"temp_max"`
|
||||
Pressure int `json:"pressure"`
|
||||
Humidity int `json:"humidity"`
|
||||
} `json:"main"`
|
||||
Visibility int `json:"visibility"`
|
||||
Wind struct {
|
||||
Speed float64 `json:"speed"`
|
||||
Deg int `json:"deg"`
|
||||
} `json:"wind"`
|
||||
Clouds struct {
|
||||
All int `json:"all"`
|
||||
} `json:"clouds"`
|
||||
Dt int `json:"dt"`
|
||||
Sys struct {
|
||||
Type int `json:"type"`
|
||||
ID int `json:"id"`
|
||||
Country string `json:"country"`
|
||||
Sunrise int `json:"sunrise"`
|
||||
Sunset int `json:"sunset"`
|
||||
} `json:"sys"`
|
||||
Timezone int `json:"timezone"`
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Cod int `json:"cod"`
|
||||
}
|
Reference in New Issue
Block a user