Documentation ¶
Index ¶
Constants ¶
View Source
const ( Current = iota Minutely Hourly Daily Alerts Standard Metric Imperial )
Const enums for query options/settings
Variables ¶
View Source
var ( // Map to store emojis Emojis map[string]string )
Functions ¶
This section is empty.
Types ¶
type ErrAPIError ¶
ErrAPIError is returned when the API returns an error
func (*ErrAPIError) Error ¶
func (e *ErrAPIError) Error() string
type ErrNoAPIKey ¶
ErrNoAPIKey is returned when no API key is provided
type ErrNoLocation ¶
ErrNoLocation is returned when no location is provided
func (*ErrNoLocation) Error ¶
func (e *ErrNoLocation) Error() string
Error returns the error message
type ErrorResponse ¶
type Openweather ¶
type Openweather struct {
// contains filtered or unexported fields
}
Openweather for the weather query
func New ¶
func New(opts ...func(*Openweather)) (*Openweather, error)
New returns a new Config with the given options
func (*Openweather) GetOneCallWeather ¶
func (c *Openweather) GetOneCallWeather() (*Weather, error)
GetOneCallWeather returns the current, minute, hourly, and daily weather plus alerts
type Weather ¶
type Weather struct { Units string `json:"units"` Lat float64 `json:"lat"` Lon float64 `json:"lon"` Timezone string `json:"timezone"` TimezoneOffset int `json:"timezone_offset"` Current *WeatherCurrent `json:"current"` Minutely []struct { Dt int `json:"dt"` Precipitation float64 `json:"precipitation"` } `json:"minutely"` Hourly *[]WeatherHourly `json:"hourly"` Daily *[]WeatherDaily `json:"daily"` Alerts *[]WeatherAlerts `json:"alerts"` }
Weather returns the weather for the given location
type WeatherAlerts ¶
type WeatherAlerts struct { SenderName string `json:"sender_name"` Event string `json:"event"` Start int64 `json:"start"` End int64 `json:"end"` Description string `json:"description"` Tags []string `json:"tags"` }
WeatherAlerts holds the weather alerts
type WeatherCurrent ¶
type WeatherCurrent struct { Dt int64 `json:"dt"` Sunrise int64 `json:"sunrise"` Sunset int64 `json:"sunset"` Temp float64 `json:"temp"` FeelsLike float64 `json:"feels_like"` Pressure int `json:"pressure"` Humidity int `json:"humidity"` DewPoint float64 `json:"dew_point"` Clouds int `json:"clouds"` Uvi float64 `json:"uvi"` Visibility int `json:"visibility"` WindSpeed float64 `json:"wind_speed"` WindGust float64 `json:"wind_gust"` WindDeg int `json:"wind_deg"` Rain Rain `json:"rain"` Snow Snow `json:"snow"` Weather []*WeatherStats `json:"weather"` }
WeatherCurrent holds the current weather data
type WeatherDaily ¶
type WeatherDaily struct { Dt int64 `json:"dt"` Sunrise int64 `json:"sunrise"` Sunset int64 `json:"sunset"` Moonrise int64 `json:"moonrise"` Moonset int64 `json:"moonset"` MoonPhase float64 `json:"moon_phase"` Temp struct { Morn float64 `json:"morn"` Day float64 `json:"day"` Eve float64 `json:"eve"` Night float64 `json:"night"` Min float64 `json:"min"` Max float64 `json:"max"` } `json:"temp"` FeelsLike struct { Morn float64 `json:"morn"` Day float64 `json:"day"` Eve float64 `json:"eve"` Night float64 `json:"night"` } `json:"feels_like"` Pressure int `json:"pressure"` Humidity int `json:"humidity"` DewPoint float64 `json:"dew_point"` WindSpeed float64 `json:"wind_speed"` WindGust float64 `json:"wind_gust"` WindDeg int `json:"wind_deg"` Clouds int `json:"clouds"` Uvi float64 `json:"uvi"` Pop float64 `json:"pop"` Rain float64 `json:"rain"` Snow float64 `json:"snow"` Weather []*WeatherStats `json:"weather"` }
WeatherDaily holds the daily weather data
type WeatherHourly ¶
type WeatherHourly struct { Dt int64 `json:"dt"` Temp float64 `json:"temp"` FeelsLike float64 `json:"feels_like"` Pressure int `json:"pressure"` Humidity int `json:"humidity"` DewPoint float64 `json:"dew_point"` Uvi float64 `json:"uvi"` Clouds int `json:"clouds"` Visibility int `json:"visibility"` WindSpeed float64 `json:"wind_speed"` WindGust float64 `json:"wind_gust"` WindDeg int `json:"wind_deg"` Pop float64 `json:"pop"` Rain Rain `json:"rain"` Snow Snow `json:"snow"` Weather []*WeatherStats `json:"weather"` }
WeatherHourly holds the hourly weather data
Click to show internal directories.
Click to hide internal directories.