Adding a Built-in Filter
Review the HTTP filter tutorial and extensions guide first.
On this page
Review the HTTP filter tutorial and extensions guide first.
- Create the filter module under
crates/filter/src/builtins/<protocol>/<category>/. - Implement
HttpFilter(orTcpFilterfor TCP-level filters). Add afrom_configfactory that deserializes aserde_yaml::Valueinto your config struct. - Register it in
crates/filter/src/registry.rsalongside the existing built-ins. - Add unit tests and doctests.
- Add an example config in the appropriate category under
examples/configs/. - Add a functional integration test in
tests/integration/tests/suite/examples/. - Run
cargo xtask generate-filter-docsto regenerate the per-filter markdown underdocs/filters/and the reference table atdocs/filters/reference.md. - Run
cargo xtask sync-example-readme --fixto regenerateexamples/README.md.
All testing requirements from conventions.md apply. A feature without tests and an example is not complete.