Initial commit
This commit is contained in:
36
vendor/github.com/briandowns/openweathermap/forecast16.go
generated
vendored
Normal file
36
vendor/github.com/briandowns/openweathermap/forecast16.go
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
package openweathermap
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
)
|
||||
|
||||
// Forecast16WeatherList holds specific query data
|
||||
type Forecast16WeatherList struct {
|
||||
Dt int `json:"dt"`
|
||||
Temp Temperature `json:"temp"`
|
||||
Pressure float64 `json:"pressure"`
|
||||
Humidity int `json:"humidity"`
|
||||
Weather []Weather `json:"weather"`
|
||||
Speed float64 `json:"speed"`
|
||||
Deg int `json:"deg"`
|
||||
Clouds int `json:"clouds"`
|
||||
Snow float64 `json:"snow"`
|
||||
Rain float64 `json:"rain"`
|
||||
}
|
||||
|
||||
// Forecast16WeatherData will hold returned data from queries
|
||||
type Forecast16WeatherData struct {
|
||||
COD int `json:"cod"`
|
||||
Message string `json:"message"`
|
||||
City City `json:"city"`
|
||||
Cnt int `json:"cnt"`
|
||||
List []Forecast16WeatherList `json:"list"`
|
||||
}
|
||||
|
||||
func (f *Forecast16WeatherData) Decode(r io.Reader) error {
|
||||
if err := json.NewDecoder(r).Decode(&f); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user