This commit is contained in:
@@ -23,6 +23,27 @@ The implemented runtime flow is:
|
||||
|
||||
Canonical payload structs live in `model`. Schema identifiers and cross-provider wire conventions live in `standards`. Source adapters live under `internal/sources`. Normalizers live under `internal/normalizers`. Provider-specific parsing helpers shared by sources and normalizers live under `internal/providers`. Sink-specific persistence mapping lives under `internal/sinks`.
|
||||
|
||||
## Architecture Style
|
||||
|
||||
`weatherfeeder` uses a pragmatic ports-and-adapters architecture rather than a
|
||||
formal framework. Provider APIs, config loading, scheduling, dispatch, and sinks
|
||||
sit outside the weather domain model and normalization rules.
|
||||
|
||||
The implementation style is:
|
||||
|
||||
- Pipeline-oriented: events flow from source polling through normalization,
|
||||
dedupe, routing, and sink fanout.
|
||||
- Schema-routed: normalizers select raw payloads by explicit schema strings, not
|
||||
source names or configured routes.
|
||||
- Provider-isolated: NWS, Open-Meteo, OpenWeather, and SPC quirks stay in
|
||||
provider-specific source, provider-helper, and normalizer packages.
|
||||
- Registry-based: built-in source drivers, normalizers, processors, and sinks
|
||||
are assembled explicitly through registries instead of dynamic plugin loading.
|
||||
- Adapter-clean: persistence and external-system details stay behind source and
|
||||
sink adapters, not in `model` or normalizers.
|
||||
- Direct Go: prefer small package-level constructors and straightforward code
|
||||
over broad abstractions.
|
||||
|
||||
## Core Design Principles
|
||||
|
||||
- Hexagonal boundaries: provider APIs, config loading, scheduling, dispatch, and sinks are external mechanisms around the weather domain model and normalization logic.
|
||||
@@ -57,6 +78,23 @@ Tests and examples:
|
||||
- The sample `cmd/weatherfeeder/config.yml` is executable test input and is load-tested.
|
||||
- Tests should keep exercising package contracts directly rather than relying only on full-daemon execution.
|
||||
|
||||
## Feedkit Boundary
|
||||
|
||||
`feedkit` provides reusable daemon infrastructure. `weatherfeeder` provides the
|
||||
weather-domain adapters, models, schemas, and mapping policy.
|
||||
|
||||
| Area | Feedkit owns | Weatherfeeder owns |
|
||||
| --- | --- | --- |
|
||||
| Config | Generic YAML shape: sources, sinks, routes, modes, cadence, and params. | Driver-specific config rules such as NWS `user_agent`, OpenWeather `units=metric`, and SPC coordinates. |
|
||||
| Events | Domain-agnostic event envelope: ID, kind, source, emitted/effective times, schema, and payload. | Event kind meaning, schema strings, and canonical weather payloads. |
|
||||
| Sources | Source interfaces, registry, expected-kind validation, HTTP helper, and default event ID helper. | NWS/Open-Meteo/OpenWeather/SPC source drivers and raw schema emission. |
|
||||
| Processing | Processor registry, normalize processor, dedupe processor, and pipeline execution. | Weather normalizers and schema-specific raw-to-canonical mapping. |
|
||||
| Dispatch | Route compilation and sink fanout mechanics. | Which weather event kinds are configured and meaningful. |
|
||||
| Sinks | Generic stdout, NATS, and Postgres sink mechanics. | Weather-specific Postgres schema and canonical event-to-row mapping. |
|
||||
|
||||
Do not move weather-domain policy into `feedkit`, and do not duplicate generic
|
||||
daemon mechanics in `weatherfeeder` when feedkit already provides the boundary.
|
||||
|
||||
## Modules Or Processing Steps
|
||||
|
||||
The implemented processing steps are source polling, normalization, dedupe, and sink dispatch.
|
||||
|
||||
Reference in New Issue
Block a user