From f7a3a38385a56841494e8c0cb9f67406090d8121 Mon Sep 17 00:00:00 2001 From: "Carpenter, Adam (CORP)" Date: Fri, 26 Nov 2021 11:58:06 -0500 Subject: feat: scaffold feature switch route extension hierarchy --- Cargo.lock | 2 +- angelsharkd/Cargo.toml | 9 +++++++-- angelsharkd/src/main.rs | 3 +++ angelsharkd/src/routes/mod.rs | 2 ++ libangelshark/Cargo.toml | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a3b5bd6..da97be8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -24,7 +24,7 @@ dependencies = [ [[package]] name = "angelsharkd" -version = "0.1.2" +version = "0.2.0" dependencies = [ "anyhow", "env_logger", diff --git a/angelsharkd/Cargo.toml b/angelsharkd/Cargo.toml index f820528..9ca459e 100644 --- a/angelsharkd/Cargo.toml +++ b/angelsharkd/Cargo.toml @@ -1,10 +1,15 @@ [package] name = "angelsharkd" -version = "0.1.2" +version = "0.2.0" edition = "2021" authors = ["Adam T. Carpenter "] description = "A HTTP interface into one or more Communication Managers" +[features] +extensions = [] +simple_search = ["extensions"] +simple_deprov = ["extensions"] + [dependencies.libangelshark] path = "../libangelshark" @@ -20,7 +25,7 @@ default-features = false version = "0.4" [dependencies.env_logger] -version = "0.8" +version = "0.9" [dependencies.serde] version = "1" diff --git a/angelsharkd/src/main.rs b/angelsharkd/src/main.rs index 8a8a53e..fb075ab 100644 --- a/angelsharkd/src/main.rs +++ b/angelsharkd/src/main.rs @@ -41,6 +41,9 @@ async fn main() -> Result<()> { }) .with(warp::log("angelsharkd")); + #[cfg(feature = "extensions")] + let routes = routes.or(routes::extensions::filter(&config)); + // Create server with shutdown signal. let (addr, server) = warp::serve(routes).bind_with_graceful_shutdown(config.bind_addr, async { signal::ctrl_c() diff --git a/angelsharkd/src/routes/mod.rs b/angelsharkd/src/routes/mod.rs index 40d024d..52373d6 100644 --- a/angelsharkd/src/routes/mod.rs +++ b/angelsharkd/src/routes/mod.rs @@ -13,6 +13,8 @@ use warp::{ }; mod dtos; +#[cfg(feature = "extensions")] +pub mod extensions; /// GET / -> Name and version # of app. pub fn index() -> impl Filter + Clone { diff --git a/libangelshark/Cargo.toml b/libangelshark/Cargo.toml index 6b945d0..8c3b77b 100644 --- a/libangelshark/Cargo.toml +++ b/libangelshark/Cargo.toml @@ -16,6 +16,6 @@ version = "0.9" features = ["vendored-openssl"] [dependencies.cached] -version = "0.25" +version = "0.26" default-features = false features = ["proc_macro"] -- cgit v1.2.3