- add new `processors` package with canonical `Processor` interface - add `processors.Registry` with Register/Build/BuildChain factory model - switch `pipeline.Pipeline` to `[]processors.Processor` - replace `normalize.Registry` + registry adapter with direct `normalize.Processor` - remove `normalize/registry.go` - update root docs to position normalize as one optional processing stage - add tests for processors registry, normalize processor behavior, and pipeline flow BREAKING CHANGE: - `pipeline.Processor` removed; use `processors.Processor` - `normalize.Registry` and old normalize processor adapter APIs removed - downstream daemons must update processor wiring to new `processors.Registry` and `normalize.NewProcessor(...)`
18 lines
836 B
Go
18 lines
836 B
Go
// Package normalize provides a concrete normalization processor for feedkit pipelines.
|
|
//
|
|
// Motivation:
|
|
// Many daemons have sources that:
|
|
// 1. fetch raw upstream data (often JSON), and
|
|
// 2. transform it into a domain's normalized payload format.
|
|
//
|
|
// Doing both steps inside Source.Poll works, but tends to make sources large and
|
|
// encourages duplication (unit conversions, common mapping helpers, etc.).
|
|
//
|
|
// This package lets a source emit a "raw" event (e.g., Schema="raw.openweather.current.v1",
|
|
// Payload=json.RawMessage), and then a normalize.Processor can convert it into a
|
|
// normalized event (e.g., Schema="weather.observation.v1", Payload=WeatherObservation{}).
|
|
//
|
|
// Key property: normalization is optional.
|
|
// If no Normalizer matches an event, Processor passes it through unchanged by default.
|
|
package normalize
|