diff --git a/fkl_cli/Cargo.toml b/fkl_cli/Cargo.toml index c1996bf..c25ac4d 100644 --- a/fkl_cli/Cargo.toml +++ b/fkl_cli/Cargo.toml @@ -87,7 +87,7 @@ rand = "0.8.5" #------------------- Message Queue ------------------- -kafka = "0.9" +#kafka = "0.9" [dev-dependencies] trycmd = "0.14.0" diff --git a/fkl_parser/src/parser/ast.rs b/fkl_parser/src/parser/ast.rs index 1bd617f..815974d 100644 --- a/fkl_parser/src/parser/ast.rs +++ b/fkl_parser/src/parser/ast.rs @@ -411,6 +411,7 @@ pub struct EnvDecl { pub datasource: Option, pub message_broker: Option, pub server: Option, + pub customs: Vec, } #[derive(Debug, Clone, PartialEq, Eq, Default)] @@ -436,3 +437,10 @@ pub struct ServerDecl { pub port: u16, pub attributes: Vec, } + +#[derive(Debug, Clone, PartialEq, Eq, Default)] +pub struct CustomDecl { + pub name: String, + pub inline_doc: String, + pub attributes: Vec, +} diff --git a/fkl_parser/src/parser/parser.rs b/fkl_parser/src/parser/parser.rs index cda901e..e9244df 100644 --- a/fkl_parser/src/parser/parser.rs +++ b/fkl_parser/src/parser/parser.rs @@ -1641,6 +1641,7 @@ env Local { }), message_broker: None, server: None, + customs: vec![] })); } @@ -1662,9 +1663,31 @@ env Local { port: 8899, attributes: vec![] }), + customs: vec![] })); } + #[test] + fn custom_env() { + let decls = parse(r#" +env Local { + kafka { + host: "localhost" + port: 9092 + } +}"#).unwrap(); + + assert_eq!(decls[0], FklDeclaration::Env(EnvDecl { + name: "Local".to_string(), + inline_doc: "".to_string(), + datasource: None, + message_broker: None, + server: None, + customs: vec![] + })); + + } + #[test] fn include_other_file() { let _decls = parse(r#"include "./layer.rs""#).or_else(|e| {