Skip to content

Commit 4c031fa

Browse files
committed
feat(args): augment LaunchConfiguration
Augment LaunchConfiguration with GeneralConfigSection that may include general, global settings. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
1 parent 7a247f8 commit 4c031fa

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

args/src/lib.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,24 @@ impl From<MemFile> for FinalizedMemFile {
312312
}
313313
}
314314

315+
/// General configuration section for the dataplane.
316+
///
317+
#[derive(
318+
Debug,
319+
PartialEq,
320+
Eq,
321+
serde::Serialize,
322+
rkyv::Serialize,
323+
rkyv::Deserialize,
324+
rkyv::Archive,
325+
CheckBytes,
326+
)]
327+
#[rkyv(attr(derive(Debug, PartialEq, Eq)))]
328+
pub struct GeneralConfigSection {
329+
/// Name to give to this dataplane/gateway
330+
name: Option<String>,
331+
}
332+
315333
/// Enum to represent either a TCP socket address or a UNIX socket path
316334
#[derive(
317335
Debug, Clone, PartialEq, Eq, serde::Serialize, rkyv::Serialize, rkyv::Deserialize, rkyv::Archive,
@@ -569,6 +587,8 @@ pub struct ConfigServerSection {
569587
)]
570588
#[rkyv(attr(derive(PartialEq, Eq, Debug)))]
571589
pub struct LaunchConfiguration {
590+
/// General configuration section
591+
pub general: GeneralConfigSection,
572592
/// Dynamic configuration server settings
573593
pub config_server: ConfigServerSection,
574594
/// Packet processing driver configuration
@@ -1065,6 +1085,9 @@ impl TryFrom<CmdArgs> for LaunchConfiguration {
10651085

10661086
fn try_from(value: CmdArgs) -> Result<Self, InvalidCmdArguments> {
10671087
Ok(LaunchConfiguration {
1088+
general: GeneralConfigSection {
1089+
name: value.get_name().cloned(),
1090+
},
10681091
config_server: ConfigServerSection {
10691092
address: value
10701093
.grpc_address()

0 commit comments

Comments
 (0)