From 859cebd12b78b6f1ec63a5522aa9032c009dd9d2 Mon Sep 17 00:00:00 2001 From: hanemile Date: Fri, 10 Jul 2020 16:24:19 +0200 Subject: defined some structs --- structs.go | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 structs.go diff --git a/structs.go b/structs.go new file mode 100644 index 0000000..d5055ae --- /dev/null +++ b/structs.go @@ -0,0 +1,83 @@ +package main + +type onecallResponse struct { + Lat float64 `json:"lat"` + Lon float64 `json:"lon"` + Timezone string `json:"timezone"` + TimezoneOffset int `json:"timezone_offset"` + Current struct { + Dt int `json:"dt"` + Sunrise int `json:"sunrise"` + Sunset int `json:"sunset"` + Temp float64 `json:"temp"` + FeelsLike float64 `json:"feels_like"` + Pressure int `json:"pressure"` + Humidity int `json:"humidity"` + DewPoint float64 `json:"dew_point"` + Uvi float64 `json:"uvi"` + Clouds int `json:"clouds"` + Visibility int `json:"visibility"` + WindSpeed float64 `json:"wind_speed"` + WindDeg int `json:"wind_deg"` + WindGust float64 `json:"wind_gust"` + Weather []struct { + ID int `json:"id"` + Main string `json:"main"` + Description string `json:"description"` + Icon string `json:"icon"` + } `json:"weather"` + } `json:"current"` + Hourly []struct { + Dt int `json:"dt"` + Temp float64 `json:"temp"` + FeelsLike float64 `json:"feels_like"` + Pressure int `json:"pressure"` + Humidity int `json:"humidity"` + DewPoint float64 `json:"dew_point"` + Clouds int `json:"clouds"` + WindSpeed float64 `json:"wind_speed"` + WindDeg int `json:"wind_deg"` + Weather []struct { + ID int `json:"id"` + Main string `json:"main"` + Description string `json:"description"` + Icon string `json:"icon"` + } `json:"weather"` + Rain struct { + OneH float64 `json:"1h"` + } `json:"rain,omitempty"` + } `json:"hourly"` + Daily []struct { + Dt int `json:"dt"` + Sunrise int `json:"sunrise"` + Sunset int `json:"sunset"` + Temp struct { + Day float64 `json:"day"` + Min float64 `json:"min"` + Max float64 `json:"max"` + Night float64 `json:"night"` + Eve float64 `json:"eve"` + Morn float64 `json:"morn"` + } `json:"temp"` + FeelsLike struct { + Day float64 `json:"day"` + Night float64 `json:"night"` + Eve float64 `json:"eve"` + Morn float64 `json:"morn"` + } `json:"feels_like"` + Pressure int `json:"pressure"` + Humidity int `json:"humidity"` + DewPoint float64 `json:"dew_point"` + WindSpeed float64 `json:"wind_speed"` + WindDeg int `json:"wind_deg"` + Weather []struct { + ID int `json:"id"` + Main string `json:"main"` + Description string `json:"description"` + Icon string `json:"icon"` + } `json:"weather"` + Clouds int `json:"clouds"` + Rain float64 `json:"rain,omitempty"` + Uvi float64 `json:"uvi"` + } `json:"daily"` +} -- cgit 1.4.1