From 94b1a11326ad21b11e3b21c038daa498d8bb215b Mon Sep 17 00:00:00 2001 From: soyouzpanda Date: Thu, 10 Oct 2024 21:04:01 +0200 Subject: [PATCH] feat: create colmena library --- Cargo.toml | 8 ++++++++ src/lib.rs | 16 ++++++++++++++++ src/nix/host/generic.rs | 2 +- src/nix/host/mod.rs | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index dad0f43..c5b8610 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,3 +51,11 @@ features = [ "rt-multi-thread", "sync", ] + +[[bin]] +name = "colmena" +path = "src/main.rs" + +[lib] +name = "colmena" +path = "src/lib.rs" diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..f1ac46a --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,16 @@ +#![allow(dead_code)] + +mod cli; +mod command; +mod error; +mod job; +mod nix; +mod progress; +mod troubleshooter; +mod util; + +pub use nix::host::generic::Request as GenericRequest; +pub use nix::host::generic::Response as GenericResponse; +pub use nix::host::CopyOptions; +pub use nix::key::{Key, UploadAt}; +pub use nix::store::StorePath; diff --git a/src/nix/host/generic.rs b/src/nix/host/generic.rs index e58b6ba..29d8516 100644 --- a/src/nix/host/generic.rs +++ b/src/nix/host/generic.rs @@ -3,7 +3,7 @@ use std::process::Stdio; use async_trait::async_trait; use serde::{Deserialize, Serialize}; -use tokio::io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader, BufWriter}; +use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader, BufWriter}; use tokio::process::{Child, ChildStdin, ChildStdout, Command}; use super::{CopyDirection, CopyOptions, Host, RebootOptions}; diff --git a/src/nix/host/mod.rs b/src/nix/host/mod.rs index 8d8a40b..3cc35f6 100644 --- a/src/nix/host/mod.rs +++ b/src/nix/host/mod.rs @@ -15,7 +15,7 @@ pub use local::Local; mod key_uploader; -mod generic; +pub mod generic; pub use generic::GenericHost; #[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]