Updates in preparation for adding forecast sources.

This commit is contained in:
2026-01-16 00:04:37 -06:00
parent e10ba804ca
commit 0fcc536885
6 changed files with 162 additions and 61 deletions

View File

@@ -34,7 +34,7 @@
// as they do not define additional Normalizer types.
//
// 2. Provider-level shared helpers live under the provider directory:
// internal/normalizers/<provider>/
// internal/providers/<provider>/
//
// Use this for provider-specific quirks that should be shared by BOTH sources
// and normalizers (time parsing, URL/unit invariants, ID normalization, etc.).
@@ -44,8 +44,6 @@
// - types.go (provider JSON structs)
// - common.go (provider-shared helpers)
// - mapping.go (provider mapping logic)
// Use common.go only when you truly have “shared across multiple normalizers
// within this provider” helpers.
//
// 3. Cross-provider helpers live in:
// internal/normalizers/common/

View File

@@ -0,0 +1,19 @@
// FILE: ./internal/normalizers/openmeteo/common.go
package openmeteo
import (
"time"
openmeteo "gitea.maximumdirect.net/ejr/weatherfeeder/internal/providers/openmeteo"
)
// parseOpenMeteoTime parses Open-Meteo timestamps.
//
// The actual parsing logic lives in internal/providers/openmeteo so both the
// source (envelope EffectiveAt / event ID) and normalizer (canonical payload)
// can share identical timestamp behavior.
//
// We keep this thin wrapper to avoid churn in the normalizer package.
func parseOpenMeteoTime(s string, tz string, utcOffsetSeconds int) (time.Time, error) {
return openmeteo.ParseTime(s, tz, utcOffsetSeconds)
}