model: add explicit JSON tags and document canonical payload contract

Add lowerCamelCase JSON tags to canonical model types (observation, forecast,
alert) to stabilize the emitted wire format and make payload structure explicit
for downstream sinks.

Introduce internal/model/doc.go to document these structs as versioned,
schema-governed payloads and clarify compatibility expectations (additive
changes preferred; breaking changes require schema bumps).

No functional behavior changes; this formalizes the canonical output contract
ahead of additional sinks and consumers.
This commit is contained in:
2026-01-15 22:39:37 -06:00
parent f13f43cf56
commit e10ba804ca
4 changed files with 56 additions and 63 deletions

View File

@@ -1,23 +1,24 @@
// FILE: internal/model/alert.go
package model
import "time"
// Placeholder for NWS alerts (GeoJSON feature properties are rich).
type WeatherAlert struct {
ID string
ID string `json:"id"`
Event string
Headline string
Description string
Instruction string
Event string `json:"event,omitempty"`
Headline string `json:"headline,omitempty"`
Description string `json:"description,omitempty"`
Instruction string `json:"instruction,omitempty"`
Severity string
Urgency string
Certainty string
Severity string `json:"severity,omitempty"`
Urgency string `json:"urgency,omitempty"`
Certainty string `json:"certainty,omitempty"`
Sent *time.Time
Effective *time.Time
Expires *time.Time
Sent *time.Time `json:"sent,omitempty"`
Effective *time.Time `json:"effective,omitempty"`
Expires *time.Time `json:"expires,omitempty"`
Areas []string
Areas []string `json:"areas,omitempty"`
}