use std::sync::Arc;
use object_store::ObjectStore;
use crate::store_paths::models::Location;
#[derive(Debug, Clone)]
pub struct OpenFolder {
pub store: Arc<dyn ObjectStore>,
pub location: Location,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct StoredFile {
pub path: object_store::path::Path,
pub relative_key: String,
pub size: u64,
pub etag: Option<String>,
pub modified_ms: i64,
}
impl StoredFile {
pub fn version(&self) -> String {
match &self.etag {
Some(etag) => etag.trim_matches('"').to_owned(),
None => format!("{}-{}", self.size, self.modified_ms),
}
}
}