weather

package
v0.0.0-...-eb4b608 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daily

type Daily struct {
	PrecipitationHours []float32          `json:"precipitation_hours"`
	PrecipitationSum   []PrecipitationSum `json:"precipitation_sum"`
	Sunrise            []string           `json:"sunrise"`
	Sunset             []string           `json:"sunset"`
	Temperature2MMax   []Temperature      `json:"temperature_2m_max"`
	Temperature2MMin   []Temperature      `json:"temperature_2m_min"`
	Time               []string           `json:"time"`
	Weathercode        []Weathercode      `json:"weathercode"`
}

func (*Daily) Forecast

func (daily *Daily) Forecast(day int) (string, error)

type Hourly

type Hourly struct {
	Precipitation []float64     `json:"precipitation"`
	Temperature2M []Temperature `json:"temperature_2m"`
	Time          []string      `json:"time"`
	Weathercode   []Weathercode `json:"weathercode"`
}

func (*Hourly) Forecast

func (hourly *Hourly) Forecast(hour int) (string, error)

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func New

func New(geocodingService model.GeocodingService, homeService model.HomeService) *Plugin

func (*Plugin) Commands

func (p *Plugin) Commands() []telebot.Command

func (*Plugin) Handlers

func (p *Plugin) Handlers(botInfo *telebot.User) []plugin.Handler

func (*Plugin) Name

func (p *Plugin) Name() string

type PrecipitationSum

type PrecipitationSum float64

func (PrecipitationSum) String

func (precipitationSum PrecipitationSum) String() string

type Response

type Response struct {
	CurrentWeather struct {
		Temperature Temperature `json:"temperature"`
		Weathercode Weathercode `json:"weathercode"`
	} `json:"current_weather"`
	Daily  Daily  `json:"daily"`
	Hourly Hourly `json:"hourly"`
}

type Temperature

type Temperature float64

func (Temperature) Icon

func (temperature Temperature) Icon() string

func (Temperature) String

func (temperature Temperature) String() string

type Weathercode

type Weathercode float32

func (Weathercode) Description

func (weathercode Weathercode) Description() string

func (Weathercode) Icon

func (weathercode Weathercode) Icon() string

Jump to

Keyboard shortcuts

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