Code cleanup and deduplication pass through weatherfeeder
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user