Iterate through pb files and parse the header

This commit is contained in:
Dominik Werder
2021-06-29 17:19:31 +02:00
parent 4ed787d3a7
commit 0326aa795a
20 changed files with 307 additions and 68 deletions

34
daqbufp2/src/lib.rs Normal file
View File

@@ -0,0 +1,34 @@
use tokio::task::JoinHandle;
use err::Error;
use netpod::{Cluster, NodeConfig, NodeConfigCached, ProxyConfig};
pub mod client;
pub mod nodes;
#[cfg(test)]
pub mod test;
pub fn spawn_test_hosts(cluster: Cluster) -> Vec<JoinHandle<Result<(), Error>>> {
let mut ret = vec![];
for node in &cluster.nodes {
let node_config = NodeConfig {
cluster: cluster.clone(),
name: format!("{}:{}", node.host, node.port),
};
let node_config: Result<NodeConfigCached, Error> = node_config.into();
let node_config = node_config.unwrap();
let h = tokio::spawn(httpret::host(node_config));
ret.push(h);
}
ret
}
pub async fn run_node(node_config: NodeConfigCached) -> Result<(), Error> {
httpret::host(node_config).await?;
Ok(())
}
pub async fn run_proxy(proxy_config: ProxyConfig) -> Result<(), Error> {
httpret::proxy::proxy(proxy_config).await?;
Ok(())
}