Close #153: Feature gate http API

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet committed 2024-03-08 18:09:33 +01:00
1 parent b7961a0568
commit c8c918234e
2 files changed
+6 -1

No files matched your search

+2 -1
View File
@@ -7,8 +7,9 @@ license-file = "LICENSE"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
default = ["message"]
default = ["message", "http-api"]
message = []
http-api = []
[dependencies]
tokio = { version = "1.36.0", features = [
+4
View File
@@ -1,5 +1,6 @@
use std::net::{IpAddr, Ipv6Addr, SocketAddr};
#[cfg(feature = "http-api")]
use api::Http;
use bytes::BytesMut;
use data::DataPlane;
@@ -64,6 +65,7 @@ pub struct Stack {
_pm: peer_manager::PeerManager,
#[cfg(feature = "message")]
_ms: message::MessageStack,
#[cfg(feature = "http-api")]
_api: api::Http,
}
@@ -170,6 +172,7 @@ impl Stack {
#[cfg(feature = "message")]
let ms = MessageStack::new(_data_plane, msg_receiver);
#[cfg(feature = "http-api")]
let api = Http::spawn(
router.clone(),
pm.clone(),
@@ -183,6 +186,7 @@ impl Stack {
_pm: pm,
#[cfg(feature = "message")]
_ms: ms,
#[cfg(feature = "http-api")]
_api: api,
})
}