Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Forecast ¶
type Forecast struct {
// the average temp in celsius
AvgTempC float64 `json:"avgTempC"`
// the average temp in fahrenheit
AvgTempF float64 `json:"avgTempF"`
// chance of rain (percentage)
ChanceOfRain int32 `json:"chanceOfRain"`
// forecast condition
Condition string `json:"condition"`
// date of the forecast
Date string `json:"date"`
// the URL of forecast condition icon. Simply prefix with either http or https to use it
IconUrl string `json:"iconUrl"`
// max temp in celsius
MaxTempC float64 `json:"maxTempC"`
// max temp in fahrenheit
MaxTempF float64 `json:"maxTempF"`
// minimum temp in celsius
MinTempC float64 `json:"minTempC"`
// minimum temp in fahrenheit
MinTempF float64 `json:"minTempF"`
// time of sunrise
Sunrise string `json:"sunrise"`
// time of sunset
Sunset string `json:"sunset"`
// will it rain
WillItRain bool `json:"willItRain"`
}
type ForecastRequest ¶
type ForecastResponse ¶
type ForecastResponse struct {
// country of the request
Country string `json:"country"`
// forecast for the next number of days
Forecast []Forecast `json:"forecast"`
// e.g 37.55
Latitude float64 `json:"latitude"`
// the local time
LocalTime string `json:"localTime"`
// location of the request
Location string `json:"location"`
// e.g -77.46
Longitude float64 `json:"longitude"`
// region related to the location
Region string `json:"region"`
// timezone of the location
Timezone string `json:"timezone"`
}
type NowRequest ¶
type NowRequest struct {
// location to get weather e.g postcode, city
Location string `json:"location"`
}
type NowResponse ¶
type NowResponse struct {
// cloud cover percentage
Cloud int32 `json:"cloud"`
// the weather condition
Condition string `json:"condition"`
// country of the request
Country string `json:"country"`
// whether its daytime
Daytime bool `json:"daytime"`
// feels like in celsius
FeelsLikeC float64 `json:"feelsLikeC"`
// feels like in fahrenheit
FeelsLikeF float64 `json:"feelsLikeF"`
// the humidity percentage
Humidity int32 `json:"humidity"`
// the URL of the related icon. Simply prefix with either http or https to use it
IconUrl string `json:"iconUrl"`
// e.g 37.55
Latitude float64 `json:"latitude"`
// the local time
LocalTime string `json:"localTime"`
// location of the request
Location string `json:"location"`
// e.g -77.46
Longitude float64 `json:"longitude"`
// region related to the location
Region string `json:"region"`
// temperature in celsius
TempC float64 `json:"tempC"`
// temperature in fahrenheit
TempF float64 `json:"tempF"`
// timezone of the location
Timezone string `json:"timezone"`
// wind degree
WindDegree int32 `json:"windDegree"`
// wind direction
WindDirection string `json:"windDirection"`
// wind in kph
WindKph float64 `json:"windKph"`
// wind in mph
WindMph float64 `json:"windMph"`
}
type WeatherService ¶
type WeatherService struct {
// contains filtered or unexported fields
}
func NewWeatherService ¶
func NewWeatherService(token string) *WeatherService
func (*WeatherService) Forecast ¶
func (t *WeatherService) Forecast(request *ForecastRequest) (*ForecastResponse, error)
Get the weather forecast for the next 1-10 days
func (*WeatherService) Now ¶
func (t *WeatherService) Now(request *NowRequest) (*NowResponse, error)
Get the current weather report for a location by postcode, city, zip code, ip address
Click to show internal directories.
Click to hide internal directories.