All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
2.1 KiB
2.1 KiB
Package model
Import Path
import "gitea.maximumdirect.net/ejr/weatherfeeder/model"
Purpose
Package model defines weatherfeeder's canonical weather payload structs.
These structs are emitted as the payload of canonical weather.*.v1 events
and are also the domain types consumed by downstream applications such as
weatherapi.
The JSON field tags on these structs are part of the wire contract. For the full field-by-field JSON contract, use the event wire contract.
Payload Types
Current canonical schema families map to these public types:
| Schema | Primary type |
|---|---|
weather.observation.v1 |
WeatherObservation |
weather.forecast.v1 |
WeatherForecastRun |
weather.forecast_discussion.v1 |
WeatherForecastDiscussion |
weather.weather_story.v1 |
WeatherStoryRun |
weather.alert.v1 |
WeatherAlertRun |
weather.outlook.v1 |
WeatherOutlookRun |
Related child types include:
WeatherObservationPresentWeatherWeatherForecastPeriodWeatherForecastDiscussionSectionWeatherStoryWeatherAlertWeatherAlertReferenceWeatherOutlookWMOCode
Wire And Compatibility Rules
- JSON tags define canonical payload field names.
- Pointer fields and fields tagged
omitemptyare optional on the wire. - Missing optional fields mean unknown or not applicable.
- Canonical measurements use metric units.
- Canonical timestamps are
time.Timevalues encoded by Go's JSON encoder. - Normalized canonical timestamps are UTC unless a field-specific contract says otherwise.
- Additive fields are compatible within a schema version.
- Removing, renaming, or changing the meaning of a field requires a new schema identifier.
Boundaries
model should not depend on source adapters, sinks, SQL column names, provider
HTTP shapes, or runtime configuration.
Consumers should not rely on packages under internal/.... Use model with
schema constants from standards and the JSON contract in
docs/integrations/events.md.