darksky

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 weather image widget

func GetWeatherWeekImage

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

GetWeatherImage returns weather image widget

Types

type DarkSkyDaily

type DarkSkyDaily struct {
	Summary string           `json:"summary"`
	Icon    string           `json:"icon"`
	Data    []DarkSkyDayData `json:"data"`
}

DarkSkyDaily contains daily weather data array

type DarkSkyData

type DarkSkyData struct {
	Time                int64   `json:"time"`
	Summary             string  `json:"summary"`
	Icon                string  `json:"icon"`
	PrecipIntensity     float32 `json:"precipIntensity"`
	PrecipProbability   float32 `json:"precipProbability"`
	Temperature         float32 `json:"temperature"`
	ApparentTemperature float32 `json:"apparentTemperature"`
	DewPoint            float32 `json:"dewPoint"`
	Humidity            float32 `json:"humidity"`
	Pressure            float32 `json:"pressure"`
	WindSpeed           float32 `json:"windSpeed"`
	WindGust            float32 `json:"windGust"`
	WindBearing         int64   `json:"windBearing"`
	CloudCover          float32 `json:"cloudCover"`
	UVIndex             int64   `json:"uvIndex"`
	Visibility          float32 `json:"visibility"`
	Ozone               float32 `json:"ozone"`
}

DarkSkyData contains main hourly weather data

func (*DarkSkyData) GetTime

func (d *DarkSkyData) GetTime(location string, tz int) time.Time

func (*DarkSkyData) TZTime

func (d *DarkSkyData) TZTime(tz int) time.Time

TZTime converts epoch date to normal with timezone

type DarkSkyDayData

type DarkSkyDayData struct {
	Time                        int64   `json:"time"`
	Summary                     string  `json:"summary"`
	Icon                        string  `json:"icon"`
	SunriseTime                 int64   `json:"sunriseTime"`
	SunsetTime                  int64   `json:"sunsetTime"`
	MoonPhase                   float32 `json:"moonPhase"`
	PrecipIntensity             float32 `json:"precipIntensity"`
	PrecipIntensityMax          float32 `json:"precipIntensityMax"`
	PrecipIntensityMaxTime      int64   `json:"precipIntensityMaxTime"`
	PrecipProbability           float32 `json:"precipProbability"`
	PrecipAccumulation          float32 `json:"precipAccumulation"`
	PrecipType                  string  `json:"precipType"`
	TemperatureHigh             float32 `json:"temperatureHigh"`
	TemperatureHighTime         int64   `json:"temperatureHighTime"`
	TemperatureLow              float32 `json:"temperatureLow"`
	TemperatureLowTime          int64   `json:"temperatureLowTime"`
	ApparentTemperatureHigh     float32 `json:"apparentTemperatureHigh"`
	ApparentTemperatureHighTime int64   `json:"apparentTemperatureHighTime"`
	ApparentTemperatureLow      float32 `json:"apparentTemperatureLow"`
	ApparentTemperatureLowTime  int64   `json:"apparentTemperatureLowTime"`
	DewPoint                    float32 `json:"dewPoint"`
	Humidity                    float32 `json:"humidity"`
	Pressure                    float32 `json:"pressure"`
	WindSpeed                   float32 `json:"windSpeed"`
	WindGust                    float32 `json:"windGust"`
	WindGustTime                int64   `json:"windGustTime"`
	WindBearing                 int64   `json:"windBearing"`
	CloudCover                  float32 `json:"cloudCover"`
	UVIndex                     int64   `json:"uvIndex"`
	UVIndexTime                 int64   `json:"uvIndexTime"`
	Visibility                  float32 `json:"visibility"`
	Ozone                       float32 `json:"ozone"`
	TemperatureMin              float32 `json:"temperatureMin"`
	TemperatureMinTime          int64   `json:"temperatureMinTime"`
	TemperatureMax              float32 `json:"temperatureMax"`
	TemperatureMaxTime          int64   `json:"temperatureMaxTime"`
	ApparentTemperatureMin      float32 `json:"apparentTemperatureMin"`
	ApparentTemperatureMinTime  int64   `json:"apparentTemperatureMinTime"`
	ApparentTemperatureMax      float32 `json:"apparentTemperatureMax"`
	ApparentTemperatureMaxTime  int64   `json:"apparentTemperatureMaxTime"`
}

DarkSkyDayData contains main daily weather data

func (*DarkSkyDayData) GetTime

func (d *DarkSkyDayData) GetTime(location string, tz int) time.Time

func (*DarkSkyDayData) TZTime

func (d *DarkSkyDayData) TZTime(tz int) time.Time

type DarkSkyFlags

type DarkSkyFlags struct {
	Sources        []string `json:"sources"`
	NearestStation float32  `json:"nearest-station"`
	Units          string   `json:"units"`
}

DarkSkyFlags contains response flags

type DarkSkyHourly

type DarkSkyHourly struct {
	Summary string        `json:"summary"`
	Icon    string        `json:"icon"`
	Data    []DarkSkyData `json:"data"`
}

DarkSkyHourly contains hourly weather data array

type DarkSkyResponse

type DarkSkyResponse struct {
	Latitude  float32       `json:"latitude"`
	Longitude float32       `json:"longitude"`
	Timezone  string        `json:"timezone"`
	Currently DarkSkyData   `json:"currently"`
	Hourly    DarkSkyHourly `json:"hourly"`
	Daily     DarkSkyDaily  `json:"daily"`
	Flags     DarkSkyFlags  `json:"flags"`
	Offset    float64       `json:"offset"`
}

DarkSkyResponse contains main structures of API response

Jump to

Keyboard shortcuts

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