Moved shared OpenMeteo time parsing code into a shared internal/providers/openmeteo library.

This commit is contained in:
2026-01-15 10:17:56 -06:00
parent 675c5a6117
commit e92577c30e
4 changed files with 91 additions and 56 deletions

View File

@@ -17,10 +17,6 @@ import (
// ObservationSource polls an NWS station observation endpoint and emits a RAW observation Event.
//
// Key refactor:
// - Source responsibility: fetch bytes + emit a valid event envelope.
// - Normalizer responsibility: interpret raw JSON + map to canonical domain model.
//
// This corresponds to URLs like:
//
// https://api.weather.gov/stations/KSTL/observations/latest
@@ -62,7 +58,7 @@ func (s *ObservationSource) Poll(ctx context.Context) ([]event.Event, error) {
}
// Event.ID must be set BEFORE normalization (feedkit requires it).
// Prefer NWS-provided "id" (stable URL). Fallback to a stable-ish computed key.
// Prefer NWS-provided "id" (stable URL). Fallback to a stable computed key.
eventID := strings.TrimSpace(meta.ID)
if eventID == "" {
ts := meta.ParsedTimestamp