refactor!: introduce generic processors registry and remove normalize registry adapter
- 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(...)`
This commit is contained in:
22
processors/doc.go
Normal file
22
processors/doc.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// Package processors defines feedkit's generic processor abstraction and registry.
|
||||
//
|
||||
// Processors are optional pipeline stages that can transform, drop, or reject
|
||||
// events before dispatch to sinks.
|
||||
//
|
||||
// Registry provides name-based construction so daemons can assemble processor
|
||||
// chains without embedding switch statements in wiring code.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// reg := processors.NewRegistry()
|
||||
// reg.Register("normalize", func() (processors.Processor, error) {
|
||||
// return normalize.NewProcessor(myNormalizers, false), nil
|
||||
// })
|
||||
//
|
||||
// chain, err := reg.BuildChain([]string{"normalize"})
|
||||
// if err != nil {
|
||||
// // handle wiring error
|
||||
// }
|
||||
//
|
||||
// p := &pipeline.Pipeline{Processors: chain}
|
||||
package processors
|
||||
Reference in New Issue
Block a user