Reorder Config fields for test-config command

This order looks more readable to me, with:
- one line options at the beginning of config
- streams at the end of config
- filters at the end of streams
- actions at the end of filters
This commit is contained in:
ppom 2025-05-28 12:00:00 +02:00
commit 1a5548c871
No known key found for this signature in database
2 changed files with 9 additions and 9 deletions

View file

@ -19,22 +19,21 @@ pub type Patterns = BTreeMap<String, Arc<Pattern>>;
#[cfg_attr(test, derive(Default))]
#[serde(deny_unknown_fields)]
pub struct Config {
#[serde(default)]
patterns: Patterns,
#[serde(default)]
streams: BTreeMap<String, Stream>,
#[serde(default = "num_cpus::get")]
concurrency: usize,
#[serde(default = "dot", skip_serializing_if = "String::is_empty")]
state_directory: String,
#[serde(default)]
patterns: Patterns,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
start: Vec<Vec<String>>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
stop: Vec<Vec<String>>,
#[serde(default = "dot", skip_serializing_if = "String::is_empty")]
state_directory: String,
#[serde(default)]
streams: BTreeMap<String, Stream>,
// This field only serve the purpose of having a top-level place for saving YAML variables
#[serde(default, skip_serializing, rename = "definitions")]

View file

@ -19,7 +19,6 @@ use super::{Action, Match, Pattern, Patterns};
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Filter {
actions: BTreeMap<String, Action>,
#[serde(skip)]
longuest_action_duration: TimeDelta,
@ -38,6 +37,8 @@ pub struct Filter {
#[serde(skip)]
retry_duration: Option<TimeDelta>,
actions: BTreeMap<String, Action>,
#[serde(skip)]
name: String,
#[serde(skip)]