#[derive(Debug, Clone, PartialEq, Eq)]
pub enum StoreKind {
S3 {
bucket: String,
region: Option<String>,
endpoint: Option<String>,
profile: Option<String>,
},
Filesystem { root: String },
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Location {
pub store: StoreKind,
pub prefix: String,
}
impl std::fmt::Display for Location {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.store {
StoreKind::S3 { bucket, .. } => write!(formatter, "s3://{bucket}/{}", self.prefix),
StoreKind::Filesystem { root } => {
write!(formatter, "{}/{}", root.trim_end_matches('/'), self.prefix)
}
}
}
}