Documentation ¶
Index ¶
- Variables
- func Icon(code string) string
- func MoonIdx(key string) int
- type AreaName
- type Astronomy
- type Country
- type CurrentCondition
- type EwwVariables
- type Hour
- type Hourly
- type Moon
- type NearestArea
- type Region
- type Request
- type Weather
- type WeatherDesc
- type WeatherForcast
- type WeatherIconURL
- type WeatherURL
Constants ¶
This section is empty.
Variables ¶
View Source
var MOON_PHASES = [8]string{
"🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘",
}
View Source
var MOON_PHASES_LOOKUP = map[string]int{
"New Moon": 0,
"Waxing Crescent": 1,
"First Quarter": 2,
"Waxing Gibbous": 3,
"Full Moon": 4,
"Waning Gibbous": 5,
"Last Quarter": 6,
"Waning Crescent": 7,
}
View Source
var WEATHER_SYMBOL = map[string]string{
"Unknown": "",
"Cloudy": "",
"Fog": "",
"HeavyRain": "",
"HeavyShowers": "",
"HeavySnow": "",
"HeavySnowShowers": "",
"LightRain": "",
"LightShowers": "",
"LightSleet": "",
"LightSleetShowers": "",
"LightSnow": "",
"LightSnowShowers": "",
"PartlyCloudy": "",
"Sunny": "",
"ThunderyHeavyRain": "",
"ThunderyShowers": "",
"ThunderySnowShowers": "",
"VeryCloudy": "",
}
weather Icons
View Source
var WEATHER_SYMBOL_WIDTH = map[string]int{
"✨": 2,
"☁️": 1,
"🌫": 2,
"🌧": 2,
"❄️": 1,
"🌦": 1,
"🌨": 2,
"⛅️": 2,
"☀️": 1,
"🌩": 2,
"⛈": 1,
}
not used anymore
View Source
var WWO_CODE = map[string]string{
"113": "Sunny",
"116": "PartlyCloudy",
"119": "Cloudy",
"122": "VeryCloudy",
"143": "Fog",
"176": "LightShowers",
"179": "LightSleetShowers",
"182": "LightSleet",
"185": "LightSleet",
"200": "ThunderyShowers",
"227": "LightSnow",
"230": "HeavySnow",
"248": "Fog",
"260": "Fog",
"263": "LightShowers",
"266": "LightRain",
"281": "LightSleet",
"284": "LightSleet",
"293": "LightRain",
"296": "LightRain",
"299": "HeavyShowers",
"302": "HeavyRain",
"305": "HeavyShowers",
"308": "HeavyRain",
"311": "LightSleet",
"314": "LightSleet",
"317": "LightSleet",
"320": "LightSnow",
"323": "LightSnowShowers",
"326": "LightSnowShowers",
"329": "HeavySnow",
"332": "HeavySnow",
"335": "HeavySnowShowers",
"338": "HeavySnow",
"350": "LightSleet",
"353": "LightShowers",
"356": "HeavyShowers",
"359": "HeavyRain",
"362": "LightSleetShowers",
"365": "LightSleetShowers",
"368": "LightSnowShowers",
"371": "HeavySnowShowers",
"374": "LightSleetShowers",
"377": "LightSleet",
"386": "ThunderyShowers",
"389": "ThunderyHeavyRain",
"392": "ThunderySnowShowers",
"395": "HeavySnowShowers",
}
Functions ¶
Types ¶
type CurrentCondition ¶
type CurrentCondition struct { FeelsLikeC string `json:"FeelsLikeC"` FeelsLikeF string `json:"FeelsLikeF"` Cloudcover string `json:"cloudcover"` Humidity string `json:"humidity"` LocalObsDateTime string `json:"localObsDateTime"` ObservationTime string `json:"observation_time"` PrecipInches string `json:"precipInches"` PrecipMM string `json:"precipMM"` Pressure string `json:"pressure"` PressureInches string `json:"pressureInches"` TempC string `json:"temp_C"` TempF string `json:"temp_F"` UvIndex string `json:"uvIndex"` Visibility string `json:"visibility"` VisibilityMiles string `json:"visibilityMiles"` WeatherCode string `json:"weatherCode"` WeatherDesc []WeatherDesc `json:"weatherDesc"` WeatherIconURL []WeatherIconURL `json:"weatherIconUrl"` Winddir16Point string `json:"winddir16Point"` WinddirDegree string `json:"winddirDegree"` WindspeedKmph string `json:"windspeedKmph"` WindspeedMiles string `json:"windspeedMiles"` }
type EwwVariables ¶
type EwwVariables struct { Location string `json:"location"` Feel string `json:"feelTemp"` Current string `json:"currentTemp"` CurrentIcon string `json:"currentIcon"` CurrentDesc string `json:"currentDesc"` MoonLable string `json:"moonLabel"` Moons [8]Moon `json:"moons"` Hours []Hour `json:"hours"` }
func (*EwwVariables) String ¶
func (e *EwwVariables) String() string
type Hourly ¶
type Hourly struct { DewPointC string `json:"DewPointC"` DewPointF string `json:"DewPointF"` FeelsLikeC string `json:"FeelsLikeC"` FeelsLikeF string `json:"FeelsLikeF"` HeatIndexC string `json:"HeatIndexC"` HeatIndexF string `json:"HeatIndexF"` WindChillC string `json:"WindChillC"` WindChillF string `json:"WindChillF"` WindGustKmph string `json:"WindGustKmph"` WindGustMiles string `json:"WindGustMiles"` Chanceoffog string `json:"chanceoffog"` Chanceoffrost string `json:"chanceoffrost"` Chanceofhightemp string `json:"chanceofhightemp"` Chanceofovercast string `json:"chanceofovercast"` Chanceofrain string `json:"chanceofrain"` Chanceofremdry string `json:"chanceofremdry"` Chanceofsnow string `json:"chanceofsnow"` Chanceofsunshine string `json:"chanceofsunshine"` Chanceofthunder string `json:"chanceofthunder"` Chanceofwindy string `json:"chanceofwindy"` Cloudcover string `json:"cloudcover"` Humidity string `json:"humidity"` PrecipInches string `json:"precipInches"` PrecipMM string `json:"precipMM"` Pressure string `json:"pressure"` PressureInches string `json:"pressureInches"` TempC string `json:"tempC"` TempF string `json:"tempF"` Time string `json:"time"` UvIndex string `json:"uvIndex"` Visibility string `json:"visibility"` VisibilityMiles string `json:"visibilityMiles"` WeatherCode string `json:"weatherCode"` WeatherDesc []WeatherDesc `json:"weatherDesc"` WeatherIconURL []WeatherIconURL `json:"weatherIconUrl"` Winddir16Point string `json:"winddir16Point"` WinddirDegree string `json:"winddirDegree"` WindspeedKmph string `json:"windspeedKmph"` WindspeedMiles string `json:"windspeedMiles"` }
type NearestArea ¶
type Weather ¶
type Weather struct { Astronomy []Astronomy `json:"astronomy"` AvgtempC string `json:"avgtempC"` AvgtempF string `json:"avgtempF"` Date string `json:"date"` Hourly []Hourly `json:"hourly"` MaxtempC string `json:"maxtempC"` MaxtempF string `json:"maxtempF"` MintempC string `json:"mintempC"` MintempF string `json:"mintempF"` SunHour string `json:"sunHour"` TotalSnowCm string `json:"totalSnow_cm"` UvIndex string `json:"uvIndex"` }
type WeatherDesc ¶
type WeatherDesc struct {
Value string `json:"value"`
}
type WeatherForcast ¶
type WeatherForcast struct { CurrentCondition []CurrentCondition `json:"current_condition"` NearestArea []NearestArea `json:"nearest_area"` Request []Request `json:"request"` Weather []Weather `json:"weather"` }
func GetWeatherData ¶
func GetWeatherData() (w WeatherForcast, err error)
func (*WeatherForcast) Hours ¶
func (w *WeatherForcast) Hours() []Hour
type WeatherIconURL ¶
type WeatherIconURL struct {
Value string `json:"value"`
}
type WeatherURL ¶
type WeatherURL struct {
Value string `json:"value"`
}
Click to show internal directories.
Click to hide internal directories.