weather

package
v0.0.0-...-e7fbf99 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWeatherImage

func GetWeatherImage(ctx *bot.Context) (buf *bytes.Buffer, err error)

GetWeatherImage returns buffer with weather image

Types

type CityData

type CityData struct {
	Name string `json:"name"`
}

CityData Weather city data struct

type CloudsData

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

CloudsData Weather cloud data struct

type Forecast

type Forecast struct {
	Cod     string        `json:"cod"`
	Weather []WeatherData `json:"list"`
	City    CityData      `json:"city"`
}

Forecast Weather forecast struct

type MainData

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

MainData Weather main data struct

type WDescData

type WDescData struct {
	Id   int64  `json:"id"`
	Main string `json:"main"`
	Desc string `json:"description"`
	Icon string `json:"icon"`
}

WDescData Weather description struct

type WeatherData

type WeatherData struct {
	Time   int64       `json:"dt"`
	Main   MainData    `json:"main"`
	Wind   WindData    `json:"wind"`
	Clouds CloudsData  `json:"clouds"`
	WDesc  []WDescData `json:"weather"`
}

WeatherData Weather data struct

func (WeatherData) TZTime

func (w WeatherData) TZTime(tz int) time.Time

TZTime returns time in specified timezone

type WindData

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

WindData Weather wind data struct

Jump to

Keyboard shortcuts

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