WIP: Add progenitor client

This commit is contained in:
Daniel Lundin 2024-12-14 22:47:40 +01:00
parent a5e3170d37
commit b07d037a7d
Signed by: dln
SSH key fingerprint: SHA256:dQy1Xj3UiqJYpKR5ggQ2bxgz4jCH8IF+k3AB8o0kmdI
11 changed files with 1016 additions and 39 deletions

View file

@ -7,10 +7,14 @@ license = "MPL-2.0"
[dependencies]
anyhow.workspace = true
clap.workspace = true
progenitor.workspace = true
reqwest.workspace = true
schemars.workspace = true
serde.workspace = true
tokio.workspace = true
tracing.workspace = true
tracing-chrome.workspace = true
tracing-subscriber.workspace = true
tracing.workspace = true
[[bin]]
name = "patagia-agent"

View file

@ -3,6 +3,8 @@ 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 {}
@ -19,6 +21,10 @@ async fn main() -> Result<()> {
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(())
}

3
agent/src/patagia_api.rs Normal file
View file

@ -0,0 +1,3 @@
use progenitor::generate_api;
generate_api!(spec = "../api.json", derives = [schemars::JsonSchema]);