metaweather

package
v0.0.0-...-a5360b3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocationSearch

func LocationSearch(latt float64, long float64) (int, error)

LocationSearch searches near locations for given coordinates.

Types

type Location

type Location struct {
	Title        string `json:"title"`         // Name of the location
	LocationType string `json:"location_type"` // City|Region / State / Province|Country|Continent
	WOEID        int    `json:"woeid"`         // Where on The Earth ID
	Distance     int    `json:"distance"`      // Distance from given latitude and longitude in meters
}

Location represents metaweather location structure

type Weather

type Weather struct {
	ID                   int       `json:"id"`
	WeatherStateName     string    `json:"weather_state_name"`
	WeatherStateAbbr     string    `json:"weather_state_abbr"`
	WindDirectionCompass string    `json:"wind_direction_compass"`
	Created              time.Time `json:"created"`
	ApplicableDate       string    `json:"applicable_date"`
	MinTemperature       float64   `json:"min_temp"`
	MaxTemperature       float64   `json:"max_temp"`
	TheTemperature       float64   `json:"the_temp"`
	WindSpeed            float64   `json:"wind_speed"`
	WindDirection        float64   `json:"wind_direction"`
	AirPressure          float64   `json:"air_pressure"`
	Humidity             int       `json:"humidity"`
	Visibility           float64   `json:"visibility"`
	Predictability       int       `json:"predictability"`
}

Weather represents metaweather consolidated weathers in each day

func LocationForecast

func LocationForecast(woeid int) ([]Weather, error)

LocationForecast forecasts weather of the 5 next days in the given location. Location is given by on the Earth ID.

Jump to

Keyboard shortcuts

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