use std::io;
pub mod fetch;
pub mod iroh;
pub mod node;
pub mod seeder;
pub use iroh::EndpointConfig;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("HTTP fetch failed: {0}")]
Http(String),
#[error("iroh error: {0}")]
Iroh(String),
#[error("I/O error: {0}")]
Io(#[from] io::Error),
#[error("CID mismatch: expected {expected}, got {actual}")]
CidMismatch {
expected: String,
actual: String,
},
#[error("CID error: {0}")]
Cid(String),
}
impl From<radicle_artifact_core::Error> for Error {
fn from(e: radicle_artifact_core::Error) -> Self {
use radicle_artifact_core::Error as Core;
match e {
Core::Io(e) => Error::Io(e),
Core::Cid(s) => Error::Cid(s),
Core::CidMismatch { expected, actual } => Error::CidMismatch { expected, actual },
Core::Key(s) => Error::Iroh(s),
}
}
}