[import-netapp] import Netapp code into Garage codebase

This commit is contained in:
Alex Auvolat
2024-02-13 12:55:41 +01:00
parent a2ab275da8
commit 5ea24254a9
38 changed files with 3741 additions and 118 deletions
+1 -2
View File
@@ -15,6 +15,7 @@ path = "lib.rs"
[dependencies]
garage_db.workspace = true
garage_net.workspace = true
arc-swap.workspace = true
async-trait.workspace = true
@@ -40,8 +41,6 @@ toml.workspace = true
futures.workspace = true
tokio.workspace = true
netapp.workspace = true
http.workspace = true
hyper.workspace = true
+5 -5
View File
@@ -85,15 +85,15 @@ impl FixedBytes32 {
}
}
impl From<netapp::NodeID> for FixedBytes32 {
fn from(node_id: netapp::NodeID) -> FixedBytes32 {
impl From<garage_net::NodeID> for FixedBytes32 {
fn from(node_id: garage_net::NodeID) -> FixedBytes32 {
FixedBytes32::try_from(node_id.as_ref()).unwrap()
}
}
impl From<FixedBytes32> for netapp::NodeID {
fn from(bytes: FixedBytes32) -> netapp::NodeID {
netapp::NodeID::from_slice(bytes.as_slice()).unwrap()
impl From<FixedBytes32> for garage_net::NodeID {
fn from(bytes: FixedBytes32) -> garage_net::NodeID {
garage_net::NodeID::from_slice(bytes.as_slice()).unwrap()
}
}
+2 -2
View File
@@ -24,8 +24,8 @@ pub enum Error {
#[error(display = "Invalid HTTP header value: {}", _0)]
HttpHeader(#[error(source)] http::header::ToStrError),
#[error(display = "Netapp error: {}", _0)]
Netapp(#[error(source)] netapp::error::Error),
#[error(display = "Network error: {}", _0)]
Net(#[error(source)] garage_net::error::Error),
#[error(display = "DB error: {}", _0)]
Db(#[error(source)] garage_db::Error),