Moved the weatherfeeder model out of internal/ so that downstream consumers can import it directly.
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
This commit is contained in:
55
model/observation.go
Normal file
55
model/observation.go
Normal file
@@ -0,0 +1,55 @@
|
||||
// FILE: internal/model/observation.go
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type WeatherObservation struct {
|
||||
// Identity / metadata
|
||||
StationID string `json:"stationId,omitempty"`
|
||||
StationName string `json:"stationName,omitempty"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
|
||||
// Canonical internal representation (provider-independent).
|
||||
ConditionCode WMOCode `json:"conditionCode"`
|
||||
ConditionText string `json:"conditionText,omitempty"`
|
||||
IsDay *bool `json:"isDay,omitempty"`
|
||||
|
||||
// Provider-specific “evidence” for troubleshooting mapping and drift.
|
||||
ProviderRawDescription string `json:"providerRawDescription,omitempty"`
|
||||
|
||||
// Human-facing (legacy / transitional)
|
||||
TextDescription string `json:"textDescription,omitempty"`
|
||||
|
||||
// Provider-specific (legacy / transitional)
|
||||
IconURL string `json:"iconUrl,omitempty"`
|
||||
|
||||
// Core measurements (nullable)
|
||||
TemperatureC *float64 `json:"temperatureC,omitempty"`
|
||||
DewpointC *float64 `json:"dewpointC,omitempty"`
|
||||
|
||||
WindDirectionDegrees *float64 `json:"windDirectionDegrees,omitempty"`
|
||||
WindSpeedKmh *float64 `json:"windSpeedKmh,omitempty"`
|
||||
WindGustKmh *float64 `json:"windGustKmh,omitempty"`
|
||||
|
||||
BarometricPressurePa *float64 `json:"barometricPressurePa,omitempty"`
|
||||
SeaLevelPressurePa *float64 `json:"seaLevelPressurePa,omitempty"`
|
||||
VisibilityMeters *float64 `json:"visibilityMeters,omitempty"`
|
||||
|
||||
RelativeHumidityPercent *float64 `json:"relativeHumidityPercent,omitempty"`
|
||||
ApparentTemperatureC *float64 `json:"apparentTemperatureC,omitempty"`
|
||||
|
||||
ElevationMeters *float64 `json:"elevationMeters,omitempty"`
|
||||
RawMessage string `json:"rawMessage,omitempty"`
|
||||
|
||||
PresentWeather []PresentWeather `json:"presentWeather,omitempty"`
|
||||
CloudLayers []CloudLayer `json:"cloudLayers,omitempty"`
|
||||
}
|
||||
|
||||
type CloudLayer struct {
|
||||
BaseMeters *float64 `json:"baseMeters,omitempty"`
|
||||
Amount string `json:"amount,omitempty"`
|
||||
}
|
||||
|
||||
type PresentWeather struct {
|
||||
Raw map[string]any `json:"raw,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user