weather

package
v0.0.0-...-07f0aa0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetForecast

func GetForecast(cfg *config.Forecast) (string, error)

Types

type Fact

type Fact struct {
	Temp       int     `json:"temp"`       // Температура (°C)
	FeelsLike  int     `json:"feels_like"` // Ощущаемая температура (°C).
	Condition  string  `json:"condition"`
	WindSpeed  float64 `json:"wind_speed"` // Скорость ветра (в м/с).
	WindDir    string  `json:"wind_dir"`
	WindGust   float64 `json:"wind_gust"`
	PressureMm int     `json:"pressure_mm"` // Давление (в мм рт. ст.).
	PressurePa int     `json:"pressure_pa"` // Давление (в гектопаскалях).
	Humidity   int     `json:"humidity"`    // Влажность воздуха (в процентах).
}

func (Fact) ConditionReadable

func (r Fact) ConditionReadable() string

func (Fact) WindDirReadable

func (r Fact) WindDirReadable() string

type Forecast

type Forecast struct {
	Date    string `json:"date"`
	Sunrise string `json:"sunrise"`
	Sunset  string `json:"sunset"`
	Parts   struct {
		DayShort   part `json:"day_short"`
		NightShort part `json:"night_short"`
	} `json:"parts"`
}

type Response

type Response struct {
	Now  uint64 `json:"now"`
	Info struct {
		Url           string `json:"url"`
		DefPressureMm int    `json:"def_pressure_mm"`
	} `json:"info"`
	Yesterday struct {
		Temp int `json:"temp"`
	} `json:"yesterday"`
	Fact      Fact       `json:"fact"`
	Forecasts []Forecast `json:"forecasts"`
}

Jump to

Keyboard shortcuts

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