Commit Graph

14 Commits

Author SHA1 Message Date
84c4efbc2e normalizers/openweather: extract shared helpers into common.go
Refactor OpenWeather normalizers to improve structure and reuse by moving
provider-specific helper functions out of observation.go and into a new
common.go.

This keeps observation.go focused on schema matching and domain mapping,
preserves the “one normalizer per file” convention, and establishes a clear
home for helpers that will be shared by future OpenWeather forecast and alert
normalizers.

No functional behavior changes; this is a pure internal refactor.
2026-01-15 10:41:56 -06:00
8968b6bdcd Refactor normalizers: dedupe JSON decode + event finalize
Add shared normalizer helpers to centralize payload extraction, JSON decoding,
and event finalization/validation.

Refactor NWS, Open-Meteo, and OpenWeather observation normalizers to use the
shared spine, removing repeated boilerplate while preserving provider-specific
mapping logic.
2026-01-15 10:36:18 -06:00
e92577c30e Moved shared OpenMeteo time parsing code into a shared internal/providers/openmeteo library. 2026-01-15 10:17:56 -06:00
675c5a6117 Removed model.Event and model.Kind from weatherfeeder, since these are imported from feedkit upstream. 2026-01-15 09:56:18 -06:00
59111a1c82 sources: standardize HTTP source config + factor raw-event boilerplate
- Require params.user_agent for all HTTP sources (uniform config across providers)
- Add common.RequireHTTPSourceConfig() to validate name/url/user_agent in one call
- Add common.NewHTTPClient() with DefaultHTTPTimeout for consistent client setup
- Add common.SingleRawEvent() to centralize event envelope construction + validation
- Refactor NWS/Open-Meteo/OpenWeather observation sources to use new helpers
2026-01-15 09:43:22 -06:00
e28ff49201 Moved common HTTP body fetch code into a shared helper function. 2026-01-15 08:58:56 -06:00
b21ed856e9 Fixed an ordering bug in wmo_text.go. 2026-01-15 08:14:20 -06:00
f43babdfd2 openmeteo: refactored the OpenMeteo source files to relocate normalization logic to internal/normalizers. 2026-01-14 12:10:32 -06:00
1f8ba05e19 Removed redundant event.go (we use feedkit's upstream implementation). 2026-01-14 12:00:48 -06:00
759fa31762 openweather: refactored the OpenWeather source files to relocate normalization logic to internal/normalizers. 2026-01-14 11:59:17 -06:00
0ba2602bcc nws: refactored the NWS source files to relocate normalization logic to internal/normalizers. 2026-01-14 11:18:21 -06:00
efc44e8c6a normalizers: added a structure for normalizers; refactoring sources -> sources+normalizers is still todo. 2026-01-14 10:35:16 -06:00
aa4774e0dd weatherfeeder: split the former maximumdirect.net/weatherd project in two.
feedkit now contains a reusable core, while weatherfeeder is a concrete implementation that includes weather-specific functions.
2026-01-13 18:14:21 -06:00
1e05b38347 Initial commit 2026-01-14 00:12:51 +00:00