twweather

package module
v0.0.0-...-d0d54b5 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2018 License: MIT Imports: 5 Imported by: 0

README

Documentation

Index

Constants

View Source
const ObservationsDataID = "O-A0001-001"

Variables

This section is empty.

Functions

This section is empty.

Types

type Observation

type Observation struct {
	StationName string
	CityName    string
	CitySN      int
	TownName    string
	TownSN      int

	WeatherElements map[string]interface{}
	// contains filtered or unexported fields
}

func (*Observation) GetDailyRainfall

func (s *Observation) GetDailyRainfall() (mm float64, err error)

GetDailyRainfall returns daily rainfall of the station in millimeters.

func (*Observation) GetHumidity

func (s *Observation) GetHumidity() (rh int, err error)

GetHumidity returns percentage of relative humidity.

func (*Observation) GetMaximumWindSpeed

func (s *Observation) GetMaximumWindSpeed() (speed float64, err error)

GetMaximumWindSpeed returns maximum wind speed in meter per second (m/s).

func (*Observation) GetPressure

func (s *Observation) GetPressure() (hPa float64, err error)

func (*Observation) GetSunHours

func (s *Observation) GetSunHours() (hours int, err error)

GetSunHours returns Sun hours

func (*Observation) GetTemperature

func (s *Observation) GetTemperature(celsius bool) (tempture float64, err error)

func (*Observation) UnmarshalXML

func (o *Observation) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Observations

type Observations map[string]*Observation

func GetObservations

func GetObservations(apiKey string) (*Observations, error)

func (Observations) UnmarshalXML

func (os Observations) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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