18 lines
826 B
Go
18 lines
826 B
Go
|
|
// Package normalize provides an OPTIONAL normalization hook 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 normalization processor can convert it into a
|
||
|
|
// normalized event (e.g., Schema="weather.observation.v1", Payload=WeatherObservation{}).
|
||
|
|
//
|
||
|
|
// Key property: normalization is optional.
|
||
|
|
// If no registered Normalizer matches an event, it passes through unchanged.
|
||
|
|
package normalize
|