pub struct FilterEntry {
pub filter_type: String,
pub branch_chains: Option<Vec<BranchChainConfig>>,
pub conditions: Vec<Condition>,
pub name: Option<String>,
pub response_conditions: Vec<ResponseCondition>,
pub failure_mode: FailureMode,
pub config: Value,
}Expand description
A single filter in the pipeline.
use praxis_core::config::FilterEntry;
let entry: FilterEntry = serde_yaml::from_str(
r#"
filter: router
routes:
- path_prefix: "/"
cluster: web
"#,
)
.unwrap();
assert_eq!(entry.filter_type, "router");
assert!(entry.conditions.is_empty());
assert!(entry.name.is_none());Fields§
§filter_type: StringFilter type name (e.g. "router", "load_balancer", or a custom name).
branch_chains: Option<Vec<BranchChainConfig>>Optional branch chains evaluated after this filter based on filter result conditions.
conditions: Vec<Condition>Ordered conditions that gate whether this filter runs on requests. Empty means the filter always runs.
name: Option<String>Optional user-assigned name for this filter entry. Used as a rejoin target by branch chains.
response_conditions: Vec<ResponseCondition>Ordered conditions that gate whether this filter runs on responses. Evaluated against the upstream response (status, headers). Empty means the filter always runs on responses.
failure_mode: FailureModePer-filter failure behaviour (open or closed).
config: ValueArbitrary YAML config passed to the filter’s factory function.
Implementations§
Source§impl FilterEntry
impl FilterEntry
Sourcepub fn warn_config_typos(&self)
pub fn warn_config_typos(&self)
Warn if config contains keys that look like typos of known fields.
Because FilterEntry uses #[serde(flatten)], a misspelled
known field (e.g. failuremode instead of failure_mode) is
silently absorbed into the catch-all config: Value. This
method detects near-matches and emits a warning.
Trait Implementations§
Source§impl Clone for FilterEntry
impl Clone for FilterEntry
Source§fn clone(&self) -> FilterEntry
fn clone(&self) -> FilterEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more