meteoclimatic

package
v0.0.0-...-784956d Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MStation

type MStation struct {
	Id          string `xml:"id"`
	Location    string `xml:"location"`
	Homepage    string `xml:"homepage"`
	Datasheet   string `xml:"datasheet"`
	Author      string `xml:"author"`
	PubDate     string `xml:"pubDate"`
	QOS         string `xml:"qos"`
	StationData struct {
		Temperature struct {
			Unit string  `xml:"unit"`
			Now  float64 `xml:"now"`
			Max  float64 `xml:"max"`
			Min  float64 `xml:"min"`
		} `xml:"temperature"`
		Humidity struct {
			Unit string  `xml:"unit"`
			Now  float64 `xml:"now"`
			Max  float64 `xml:"max"`
			Min  float64 `xml:"min"`
		} `xml:"humidity"`
		Barometre struct {
			Unit string  `xml:"unit"`
			Now  float64 `xml:"now"`
			Max  float64 `xml:"max"`
			Min  float64 `xml:"min"`
		} `xml:"barometre"`
		Wind struct {
			Unit    string  `xml:"unit"`
			Now     float64 `xml:"now"`
			Max     float64 `xml:"max"`
			Azimuth int     `xml:"azimuth"`
		} `xml:"wind"`
		Rain struct {
			Unit  string  `xml:"unit"`
			Total float64 `xml:"total"`
		} `xml:"rain"`
	} `xml:"stationdata"`
}

type MStations

type MStations struct {
	PubDate string     `xml:"pubDate"`
	Station []MStation `xml:"station"`
}

type MeteoClimatic

type MeteoClimatic struct {
	XMLData []byte
	MD      Meteodata
}

func New

func New(id string) (MeteoClimatic, error)

func (*MeteoClimatic) GetStationInfo

func (mc *MeteoClimatic) GetStationInfo() error

Parse XML and return a struct with all the data

type Meteodata

type Meteodata struct {
	XMLName       xml.Name  `xml:"meteodata"`
	Description   string    `xml:"description"`
	Link          string    `xml:"link"`
	Copyright     string    `xml:"copyright"`
	Ttl           int       `xml:"ttl"`
	PubDate       string    `xml:"pubDate"`
	Docs          string    `xml:"docs"`
	MeteoStations MStations `xml:"stations"`
}

Jump to

Keyboard shortcuts

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