[engine/matcher] Add ProcessedNode into ProcessedEvent (build broken)
-use std::collections::HashMap;
+use std::collections::{HashMap, BTreeMap};
use tornado_common_api::{Action, Event, Payload, Value};
#[derive(Debug, Clone, PartialEq)]
@@ -33,18 +33,31 @@ impl Into<Value> for InternalEvent {
#[derive(Debug, Clone)]
pub struct ProcessedEvent {
pub event: InternalEvent,
- pub rules: HashMap<String, ProcessedRule>,
- pub extracted_vars: HashMap<String, Value>,
+ pub result: ProcessedNode,
}
-impl ProcessedEvent {
- pub fn new(event: Event) -> ProcessedEvent {
- ProcessedEvent {
- event: event.into(),
- rules: HashMap::new(),
- extracted_vars: HashMap::new(),
+#[derive(Debug, Clone)]
+pub enum ProcessedNode {
+ Filter(ProcessedFilter, BTreeMap<String, ProcessedNode>),
+ Rules(ProcessedRules)
}
+
+
+#[derive(Debug, Clone)]
+pub struct ProcessedFilter {
+ pub name: String,
+ pub status: ProcessedFilterStatus
}
+
+#[derive(Debug, Clone, PartialEq)]
+pub enum ProcessedFilterStatus {
+ Matched,
+ NotMatched
+}
+#[derive(Debug, Clone)]
+pub struct ProcessedRules {
+ pub rules: HashMap<String, ProcessedRule>,
+ pub extracted_vars: HashMap<String, Value>,
}
#[derive(Debug, Clone)]
