Documentation ¶
Overview ¶
Provides interface to weather data from Chapelco Ski Resort weather station via Google Drive
Index ¶
- func ReadLastNAbsPressures(table *godbf.DbfTable, n int) []float64
- func ReadLastNDateTimes(table *godbf.DbfTable, n int) []string
- func ReadLastNDewPoints(table *godbf.DbfTable, n int) []float64
- func ReadLastNFromFloat64Field(table *godbf.DbfTable, n int, field string) []float64
- func ReadLastNPressures(table *godbf.DbfTable, n int) []float64
- func ReadLastNRainSums(table *godbf.DbfTable, n int) []float64
- func ReadLastNRelativeHumidities(table *godbf.DbfTable, n int) []float64
- func ReadLastNTemperatures(table *godbf.DbfTable, n int) []float64
- func ReadLastNWeatherRecordsToMap(n int) map[string]interface{}
- type CachedDbfTable
- type WeatherRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadLastNAbsPressures ¶
ReadLastNAbsPressures reads the last n PRES_ABS records
func ReadLastNDateTimes ¶
ReadLastNDateTimes reads the last n DATE_TIME records
func ReadLastNDewPoints ¶
ReadLastNDewPoints reads the last n CHN1_DEW records
func ReadLastNFromFloat64Field ¶
ReadLastNFromFloat64Field reads the last n records by field string
func ReadLastNPressures ¶
ReadLastNPressures reads the last n PRES_LOC records
func ReadLastNRainSums ¶
ReadLastNRainSums reads the last n RAIN_SUM records
func ReadLastNRelativeHumidities ¶
ReadLastNRelativeHumidities reads the last n CHN1_RF records
func ReadLastNTemperatures ¶
ReadLastNTemperatures reads the last n CHN1_DEG records
func ReadLastNWeatherRecordsToMap ¶
ReadLastNWeatherRecordsToMap reads the last n records in separate lists into a map with keys from code.
Types ¶
type CachedDbfTable ¶
type CachedDbfTable struct { DbfTable *godbf.DbfTable sync.RWMutex // contains filtered or unexported fields }
CachedDbfTable consists of DbfTable which holds a godbf.DfTable, updatedAt contains the time.Time it was last updated, and holds a Read/Write lock to insure that the table is in sync with when it was last updated.
type WeatherRecord ¶
type WeatherRecord struct { Datetime time.Time LocalPressure float64 AbsolutePressure float64 Temperature float64 DewPoint float64 RainSum float64 RelativeHumidity float64 }
WeatherRecord represents one weather observation from the weather station
func ReadCurrentWeatherRecord ¶
func ReadCurrentWeatherRecord() *WeatherRecord
ReadCurrentWeatherRecord reads the most recent (last 1) WeatherRecord from the DbfTable
func ReadLastNWeatherRecords ¶
func ReadLastNWeatherRecords(n int) []WeatherRecord
ReadLastNWeatherRecords reads the last n records from the cached DbfTable
func ReadLastNWeatherRecordsFromDbf ¶
func ReadLastNWeatherRecordsFromDbf(table *godbf.DbfTable, n int) []WeatherRecord
ReadLastNWeatherRecordsFromDbf reads the last n WeatherRecords from the DbfTable
func ReadWeatherRecordFromDbf ¶
func ReadWeatherRecordFromDbf(table *godbf.DbfTable, n int) *WeatherRecord
ReadWeatherRecordFromDbf reads a single WeatherRecord from the given Dbf Table.