Documentation
¶
Index ¶
- Constants
- func FetchStationData(kenn string, c *colly.Collector, cb func(StationData), ecb cfac.ErrorCallback)
- func FetchStations(c *colly.Collector, cb func(StationInfo), ecb cfac.ErrorCallback)
- func FetchStatistics(c *colly.Collector, cb func(Statistics), ecb cfac.ErrorCallback)
- type Callback
- type CustomDate
- type CustomTime
- type Measurement
- type ResponseStammInfo
- type StationData
- type StationInfo
- type Statistics
- type Timeseries
- type TimeseriesExtended
Constants ¶
View Source
const ( UrlApi = "https://odlinfo.bfs.de/json" UrlApiStatistics = UrlApi + "/stat.json" UrlApiStationList = UrlApi + "/stamm.json" UrlApiStationData = UrlApi + "/{kenn}.json" )
Variables ¶
This section is empty.
Functions ¶
func FetchStationData ¶
func FetchStationData(kenn string, c *colly.Collector, cb func(StationData), ecb cfac.ErrorCallback)
func FetchStations ¶
func FetchStations(c *colly.Collector, cb func(StationInfo), ecb cfac.ErrorCallback)
func FetchStatistics ¶
func FetchStatistics(c *colly.Collector, cb func(Statistics), ecb cfac.ErrorCallback)
Types ¶
type Callback ¶
type Callback func(Statistics)
type CustomDate ¶
func (*CustomDate) UnmarshalJSON ¶
func (c *CustomDate) UnmarshalJSON(b []byte) error
type CustomTime ¶
func (*CustomTime) UnmarshalJSON ¶
func (c *CustomTime) UnmarshalJSON(b []byte) error
type Measurement ¶
type ResponseStammInfo ¶
type ResponseStammInfo map[string]StationInfo
type StationData ¶
type StationData struct { Info StationInfo `json:"stamm"` Avg1h TimeseriesExtended `json:"mw1"` Avg24h Timeseries `json:"mw24"` }
type StationInfo ¶
type StationInfo struct { Ort string `json:"ort"` ID string `json:"kenn"` PLZ int `json:"plz,string"` Status int `json:"status"` KID int `json:"kid"` Altitude int `json:"hoehe"` Longitude float64 `json:"lon"` Latitude float64 `json:"lat"` Value float64 `json:"mw"` // in µSv/h IMIS string `json:"imis"` }
type Statistics ¶
type Statistics struct { OperationalCount int `json:"betriebsbereit"` MeasurementAvg struct { Value float64 `json:"mw"` Time CustomDate `json:"t"` } `json:"mwavg"` MeasurementMaximum struct { Value float64 `json:"mw"` // in µSv/h ID string `json:"kenn"` } `json:"mwmax"` MeasurementMin struct { Value float64 `json:"mw"` // in µSv/h Kenn string `json:"kenn"` } `json:"mwmin"` }
type Timeseries ¶
type Timeseries struct { Time []CustomDate `json:"t"` Value []float64 `json:"mw"` // in µSv/h }
type TimeseriesExtended ¶
type TimeseriesExtended struct { Time []CustomTime `json:"t"` Value []float64 `json:"mw"` // in µSv/h CheckStatus []int `json:"ps"` TimeRainProp []CustomTime `json:"tr"` RainProp []float64 `json:"r"` }
Click to show internal directories.
Click to hide internal directories.