Code cleanup and deduplication pass through weatherfeeder
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
ci/woodpecker/manual/build-image Pipeline was successful

This commit is contained in:
2026-03-28 12:01:07 -05:00
parent 2c1278a70a
commit c76088c38c
12 changed files with 533 additions and 311 deletions

View File

@@ -9,6 +9,12 @@ import (
"gitea.maximumdirect.net/ejr/weatherfeeder/internal/normalizers/openweather"
)
var builtinRegistrations = []func([]fknormalize.Normalizer) []fknormalize.Normalizer{
nws.Register,
openmeteo.Register,
openweather.Register,
}
// RegisterBuiltins registers all normalizers shipped with this binary.
//
// This mirrors internal/sources.RegisterBuiltins, but note the selection model:
@@ -27,9 +33,9 @@ func RegisterBuiltins(in []fknormalize.Normalizer) []fknormalize.Normalizer {
//
// Order here should be stable across releases to reduce surprises when adding
// new normalizers.
out = nws.Register(out)
out = openmeteo.Register(out)
out = openweather.Register(out)
for _, register := range builtinRegistrations {
out = register(out)
}
return out
}