generated from Patagia/template-nix
30 lines
737 B
Rust
30 lines
737 B
Rust
use anyhow::Result;
|
|
use clap::Parser;
|
|
use tokio::time::{sleep, Duration};
|
|
use tracing_subscriber::prelude::*;
|
|
|
|
mod patagia_api;
|
|
|
|
#[derive(Parser, Debug)]
|
|
#[command(version, about, long_about = None)]
|
|
struct Cli {}
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<()> {
|
|
let _args = Cli::parse();
|
|
let fmt_layer = tracing_subscriber::fmt::layer();
|
|
|
|
tracing_subscriber::registry()
|
|
.with(tracing_subscriber::EnvFilter::from_default_env())
|
|
.with(fmt_layer)
|
|
.init();
|
|
|
|
tracing::info!("Patagia Agent");
|
|
|
|
let client = patagia_api::Client::new("http://localhost:9474");
|
|
let result = client.version().await?;
|
|
tracing::info!("Result: {:?}", result);
|
|
|
|
sleep(Duration::from_secs(3)).await;
|
|
Ok(())
|
|
}
|