feat(tvix/store/directorysvc): add from_addr
Add --directory-service-addr arg to tvix-store CLI. Change-Id: Iea1e6f08f27f7157b21ccf397297c68358bd78a0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8743 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
parent
a1acb5bcb3
commit
bb7c76739a
6 changed files with 287 additions and 21 deletions
|
|
@ -1,10 +1,13 @@
|
|||
use crate::{proto, B3Digest, Error};
|
||||
|
||||
mod from_addr;
|
||||
mod grpc;
|
||||
mod memory;
|
||||
mod sled;
|
||||
mod traverse;
|
||||
mod utils;
|
||||
|
||||
pub use self::from_addr::from_addr;
|
||||
pub use self::grpc::GRPCDirectoryService;
|
||||
pub use self::memory::MemoryDirectoryService;
|
||||
pub use self::sled::SledDirectoryService;
|
||||
|
|
@ -15,6 +18,11 @@ pub use self::utils::DirectoryTraverser;
|
|||
/// This is a simple get and put of [crate::proto::Directory], returning their
|
||||
/// digest.
|
||||
pub trait DirectoryService: Send + Sync {
|
||||
/// Create a new instance by passing in a connection URL.
|
||||
fn from_url(url: &url::Url) -> Result<Self, Error>
|
||||
where
|
||||
Self: Sized;
|
||||
|
||||
/// Get looks up a single Directory message by its digest.
|
||||
/// In case the directory is not found, Ok(None) is returned.
|
||||
fn get(&self, digest: &B3Digest) -> Result<Option<proto::Directory>, Error>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue