Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) GetDailyForecast(ctx context.Context, lat, lng float64) ([]HourlyForecast, error)
- func (c *Client) GetForecast(ctx context.Context, lat, lng float64, exclude string) (*Forecast, error)
- func (c *Client) GetHourlyForecast(ctx context.Context, lat, lng float64) ([]HourlyForecast, error)
- type CurrentForecast
- type DailyFeelsLike
- type DailyForecast
- type DailyTemperature
- type Forecast
- type ForecastError
- type HourlyForecast
- type Minutely
- type Precipitation
- type Weather
Constants ¶
View Source
const ( UnitsStandard = "standard" UnitsMetric = "metric" UnitsImperial = "imperial" ExcludeCurrent = "current" ExcludeMinutely = "minutely" ExcludeHourly = "hourly" ExcludeDaily = "daily" LanguageEnglish = "en" EndpointOneCall = "https://api.openweathermap.org/data/2.5/onecall" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client open weather map client
func (*Client) GetDailyForecast ¶
GetDailyForecast get daily weather from the OpenWeatherMap service
func (*Client) GetForecast ¶
func (c *Client) GetForecast(ctx context.Context, lat, lng float64, exclude string) (*Forecast, error)
GetForecast requests Forecast from OpenWeatherMap API
func (*Client) GetHourlyForecast ¶
GetHourlyForecast get hourly weather from the OpenWeatherMap service
type CurrentForecast ¶
type CurrentForecast struct { CurrentTime int64 `json:"dt"` SunriseTime int64 `json:"sunrise"` SunsetTime int64 `json:"sunset"` Temperature float64 `json:"temp"` FeelsLike float64 `json:"feels_like"` Pressure int `json:"pressure"` Humidity int `json:"humidity"` DewPoint float64 `json:"dew_point"` UVIndex 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"` Rain Precipitation `json:"rain"` Snow Precipitation `json:"snow"` Weather []Weather `json:"weather"` }
func (*CurrentForecast) GetCurrentTime ¶
func (f *CurrentForecast) GetCurrentTime() time.Time
func (*CurrentForecast) GetSunriseTime ¶
func (f *CurrentForecast) GetSunriseTime() time.Time
func (*CurrentForecast) GetSunsetTime ¶
func (f *CurrentForecast) GetSunsetTime() time.Time
type DailyFeelsLike ¶
type DailyForecast ¶
type DailyForecast struct { ForecastTime int64 `json:"dt"` SunriseTime int64 `json:"sunrise"` SunsetTime int64 `json:"sunset"` MoonriseTime int64 `json:"moonrise"` MoonsetTime int64 `json:"moonset"` MoonPhase float64 `json:"moon_phase"` Temperature DailyTemperature `json:"temp"` FeelsLike DailyFeelsLike `json:"feels_like"` Pressure int `json:"pressure"` Humidity int `json:"humidity"` DewPoint float64 `json:"dew_point"` UVIndex 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"` Rain float64 `json:"rain"` Weather []Weather `json:"weather"` POP float64 `json:"pop"` }
func (*DailyForecast) GetForecastTime ¶
func (d *DailyForecast) GetForecastTime() time.Time
func (*DailyForecast) GetMoonriseTime ¶
func (d *DailyForecast) GetMoonriseTime() time.Time
func (*DailyForecast) GetMoonsetTime ¶
func (d *DailyForecast) GetMoonsetTime() time.Time
func (*DailyForecast) GetSunriseTime ¶
func (d *DailyForecast) GetSunriseTime() time.Time
func (*DailyForecast) GetSunsetTime ¶
func (d *DailyForecast) GetSunsetTime() time.Time
type DailyTemperature ¶
type Forecast ¶
type Forecast struct { Lat float64 `json:"lat"` Lon float64 `json:"lon"` TimeZone string `json:"timezone"` TimeZoneOffset int `json:"timezone_offset"` Current CurrentForecast `json:"current"` Minutely []Minutely `json:"minutely"` Hourly []HourlyForecast `json:"hourly"` Daily []DailyForecast `json:"daily"` }
type ForecastError ¶
type HourlyForecast ¶
type HourlyForecast struct { ForecastTime int64 `json:"dt"` Temperature float64 `json:"temp"` FeelsLike float64 `json:"feels_like"` Pressure int `json:"pressure"` Humidity int `json:"humidity"` DewPoint float64 `json:"dew_point"` UVIndex 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"` Rain Precipitation `json:"rain"` Snow Precipitation `json:"snow"` Weather []Weather `json:"weather"` }
func (*HourlyForecast) GetForecastTime ¶
func (f *HourlyForecast) GetForecastTime() time.Time
type Precipitation ¶
type Precipitation struct {
H float64 `json:"1h"`
}
Click to show internal directories.
Click to hide internal directories.