mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 13:11:31 +00:00
krata: restructure packages for cleanliness
This commit is contained in:
22
crates/network/bin/network.rs
Normal file
22
crates/network/bin/network.rs
Normal file
@ -0,0 +1,22 @@
|
||||
use std::str::FromStr;
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use env_logger::Env;
|
||||
use krata::dial::ControlDialAddress;
|
||||
use kratanet::NetworkService;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
struct NetworkArgs {
|
||||
#[arg(short, long, default_value = "unix:///var/lib/krata/daemon.socket")]
|
||||
connection: String,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
|
||||
let args = NetworkArgs::parse();
|
||||
let control_dial_address = ControlDialAddress::from_str(&args.connection)?;
|
||||
let mut service = NetworkService::new(control_dial_address).await?;
|
||||
service.watch().await
|
||||
}
|
Reference in New Issue
Block a user