Moved shared OpenMeteo time parsing code into a shared internal/providers/openmeteo library.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user