weather

package
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWeatherCommand

func NewWeatherCommand(slackClient client.SlackClient, config config.OpenWeather) bot.Command

NewWeatherCommand is using OpenWeatherMap to display current weather and the forecast

Types

type City

type City struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type Clouds

type Clouds struct {
	All int `json:"all"`
}

type Coord

type Coord struct {
	Lon float64 `json:"lon"`
	Lat float64 `json:"lat"`
}

type CurrentWeatherResponse

type CurrentWeatherResponse struct {
	Coord   Coord     `json:"coord"`
	Weather []Weather `json:"weather"`
	Main    Main      `json:"main"`
	Wind    Wind      `json:"wind"`
	Rain    Rain      `json:"rain"`
	Clouds  Clouds    `json:"clouds"`
	Sys     Sys       `json:"sys"`
	Dt      int       `json:"dt"`
	ID      int       `json:"id"`
	Name    string    `json:"name"`
}

type ForecastResponse

type ForecastResponse struct {
	City    `json:"city"`
	Coord   `json:"coord"`
	Country string `json:"country"`
	List    []struct {
		Dt      int `json:"dt"`
		Main    `json:"main"`
		Weather `json:"weather"`
		Clouds  `json:"clouds"`
		Wind    `json:"wind"`
	} `json:"list"`
}

type Main

type Main struct {
	Temp     float64 `json:"temp"`
	Pressure int     `json:"pressure"`
	Humidity int     `json:"humidity"`
	TempMin  float64 `json:"temp_min"`
	TempMax  float64 `json:"temp_max"`
}

type Rain

type Rain struct {
	Threehr int `json:"3h"`
}

type Sys

type Sys struct {
	Country string `json:"country"`
	Sunrise int    `json:"sunrise"`
	Sunset  int    `json:"sunset"`
}

type Weather

type Weather struct {
	ID          int    `json:"id"`
	Main        string `json:"main"`
	Description string `json:"description"`
	Icon        string `json:"icon"`
}

type Wind

type Wind struct {
	Speed float64 `json:"speed"`
	Deg   float64 `json:"deg"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL