Compare commits

..

1 commit

Author SHA1 Message Date
b07d037a7d
WIP: Add progenitor client 2024-12-15 15:29:49 +01:00
7 changed files with 29 additions and 45 deletions

17
Cargo.lock generated
View file

@ -1558,23 +1558,14 @@ version = "0.1.0"
dependencies = [
"anyhow",
"clap",
"patagia-client",
"tokio",
"tracing",
"tracing-chrome",
"tracing-subscriber",
]
[[package]]
name = "patagia-client"
version = "0.0.1"
dependencies = [
"anyhow",
"chrono",
"progenitor",
"reqwest",
"schemars",
"serde",
"tokio",
"tracing",
"tracing-chrome",
"tracing-subscriber",
]
[[package]]

View file

@ -2,13 +2,11 @@
resolver = "2"
members = [
"agent",
"client",
"controller",
"xtask",
]
default-members = [
"agent",
"client",
"controller",
"xtask",
]

View file

@ -7,11 +7,14 @@ license = "MPL-2.0"
[dependencies]
anyhow.workspace = true
clap.workspace = true
patagia-client = { path = "../client" }
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,7 +21,7 @@ async fn main() -> Result<()> {
tracing::info!("Patagia Agent");
let client = patagia_client::Client::new("http://localhost:9474");
let client = patagia_api::Client::new("http://localhost:9474");
let result = client.version().await?;
tracing::info!("Result: {:?}", result);

View file

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

View file

@ -1,13 +0,0 @@
[package]
name = "patagia-client"
version = "0.0.1"
license = "MPL-2.0"
edition = "2021"
[dependencies]
anyhow.workspace = true
chrono = { version = "0.4.0", default-features = false, features = ["serde"] }
progenitor.workspace = true
reqwest.workspace = true
schemars.workspace = true
serde.workspace = true

View file

@ -52,23 +52,14 @@
pkg-config
];
sourceAndFixtures = path: type: (craneLib.filterCargoSources path type);
jsonFilter = path: _type: builtins.match ".*json$" path != null;
sourceAndFixtures = path: type:
(jsonFilter path type) || (craneLib.filterCargoSources path type);
src = pkgs.lib.cleanSourceWith {
src = ./.;
filter = sourceAndFixtures;
};
treefmtEval = treefmt-nix.lib.evalModule pkgs {
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
nixfmt.package = pkgs.nixfmt-rfc-style;
shfmt.enable = true;
rustfmt.enable = true;
};
settings.formatter.rustfmt.command = pkgs.lib.mkForce "${pkgs.rust-toolchain}/bin/rustfmt";
};
commonArgs = {
inherit src stdenv nativeBuildInputs;
strictDeps = true;
@ -95,7 +86,6 @@
./Cargo.toml
./Cargo.lock
(craneLib.fileset.commonCargoSources ./agent)
(craneLib.fileset.commonCargoSources ./client)
(craneLib.fileset.commonCargoSources ./controller)
(craneLib.fileset.commonCargoSources ./xtask)
(craneLib.fileset.commonCargoSources crate)
@ -128,6 +118,18 @@
src = fileSetForCrate ./xtask;
}
);
treefmtEval = treefmt-nix.lib.evalModule pkgs {
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
nixfmt.package = pkgs.nixfmt-rfc-style;
shfmt.enable = true;
rustfmt.enable = true;
};
settings.formatter.rustfmt.command = pkgs.lib.mkForce "${pkgs.rust-toolchain}/bin/rustfmt";
};
in
{
# `nix build`
@ -165,6 +167,7 @@
(
commonArgs
// {
inherit cargoArtifacts;
src = fileSetForCrate ./xtask;
}
)
@ -188,6 +191,7 @@
cargo-nextest
cargo-watch
hyperfine
openssl
just
rust-dev-toolchain
watchexec