mirror of
https://framagit.org/ppom/reaction
synced 2026-03-14 20:55:47 +01:00
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:
parent
4f2eac2788
commit
1a5548c871
2 changed files with 9 additions and 9 deletions
|
|
@ -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")]
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue