node: Implement Client

Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Alexis Sellier
2022-09-13 10:16:05 +02:00
parent 35b0af9a68
commit e663e8c516
11 changed files with 228 additions and 38 deletions
+7 -2
View File
@@ -1,4 +1,5 @@
use std::path::{Path, PathBuf};
use std::rc::Rc;
use std::{fmt, fs, io};
use git_ref_format::refspec;
@@ -25,7 +26,7 @@ pub static NAMESPACES_GLOB: Lazy<refspec::PatternString> =
pub struct Storage {
path: PathBuf,
signer: Box<dyn Signer>,
signer: Rc<dyn Signer>,
}
impl fmt::Debug for Storage {
@@ -76,7 +77,7 @@ impl Storage {
Ok(Self {
path,
signer: Box::new(signer),
signer: Rc::new(signer),
})
}
@@ -84,6 +85,10 @@ impl Storage {
self.path.as_path()
}
pub fn signer(&self) -> Rc<dyn Signer> {
self.signer.clone()
}
pub fn projects(&self) -> Result<Vec<ProjId>, Error> {
let mut projects = Vec::new();