about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhanemile <mail@emile.space>2020-07-10 16:24:19 +0200
committerhanemile <mail@emile.space>2020-07-10 16:24:19 +0200
commit859cebd12b78b6f1ec63a5522aa9032c009dd9d2 (patch)
tree789ffd43e71a241fb29ebe2da8e19666385dac65
parentdbfa813aab5e45f30d2589432eaebd412e026df4 (diff)
defined some structs
-rw-r--r--structs.go83
1 files changed, 83 insertions, 0 deletions
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"`
+}