2026-03-17 09:46:39 -05:00
|
|
|
// FILE: model/observation.go
|
2026-01-13 18:14:21 -06:00
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
|
|
type WeatherObservation struct {
|
|
|
|
|
// Identity / metadata
|
2026-01-15 22:39:37 -06:00
|
|
|
StationID string `json:"stationId,omitempty"`
|
|
|
|
|
StationName string `json:"stationName,omitempty"`
|
|
|
|
|
Timestamp time.Time `json:"timestamp"`
|
2026-01-13 18:14:21 -06:00
|
|
|
|
|
|
|
|
// Canonical internal representation (provider-independent).
|
2026-03-17 11:04:51 -05:00
|
|
|
ConditionCode WMOCode `json:"conditionCode"`
|
|
|
|
|
IsDay *bool `json:"isDay,omitempty"`
|
|
|
|
|
TextDescription string `json:"textDescription,omitempty"`
|
2026-01-13 18:14:21 -06:00
|
|
|
|
|
|
|
|
// Core measurements (nullable)
|
2026-01-15 22:39:37 -06:00
|
|
|
TemperatureC *float64 `json:"temperatureC,omitempty"`
|
|
|
|
|
DewpointC *float64 `json:"dewpointC,omitempty"`
|
2026-01-13 18:14:21 -06:00
|
|
|
|
2026-01-15 22:39:37 -06:00
|
|
|
WindDirectionDegrees *float64 `json:"windDirectionDegrees,omitempty"`
|
|
|
|
|
WindSpeedKmh *float64 `json:"windSpeedKmh,omitempty"`
|
|
|
|
|
WindGustKmh *float64 `json:"windGustKmh,omitempty"`
|
2026-01-13 18:14:21 -06:00
|
|
|
|
2026-01-15 22:39:37 -06:00
|
|
|
BarometricPressurePa *float64 `json:"barometricPressurePa,omitempty"`
|
|
|
|
|
VisibilityMeters *float64 `json:"visibilityMeters,omitempty"`
|
2026-01-13 18:14:21 -06:00
|
|
|
|
2026-01-15 22:39:37 -06:00
|
|
|
RelativeHumidityPercent *float64 `json:"relativeHumidityPercent,omitempty"`
|
2026-01-17 10:36:19 -06:00
|
|
|
ApparentTemperatureC *float64 `json:"apparentTemperatureC,omitempty"`
|
2026-01-13 18:14:21 -06:00
|
|
|
|
2026-01-15 22:39:37 -06:00
|
|
|
PresentWeather []PresentWeather `json:"presentWeather,omitempty"`
|
2026-01-13 18:14:21 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type PresentWeather struct {
|
2026-01-15 22:39:37 -06:00
|
|
|
Raw map[string]any `json:"raw,omitempty"`
|
2026-01-13 18:14:21 -06:00
|
|
|
}
|