weather

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWeatherCommand

func NewWeatherCommand(base bot.BaseCommand, cfg config.OpenWeather) bot.Command

NewWeatherCommand is using OpenWeatherMap to display current weather and the forecast

Types

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 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