use orbok_core::DataClass;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum OrbokCacheNamespace {
ExtractSegments,
ChunkBundle,
EmbeddingBundle {
model_id: String,
vector_format: String,
},
PreviewCache,
}
impl OrbokCacheNamespace {
pub fn as_namespace(&self) -> String {
match self {
Self::ExtractSegments => "extract-segments:v1".to_string(),
Self::ChunkBundle => "chunk-bundle:v1".to_string(),
Self::EmbeddingBundle {
model_id,
vector_format,
} => format!("embedding-bundle:{model_id}:{vector_format}:v1"),
Self::PreviewCache => "preview-cache:v1".to_string(),
}
}
pub fn payload_version(&self) -> u32 {
1
}
pub fn data_class(&self) -> DataClass {
match self {
Self::ExtractSegments | Self::ChunkBundle | Self::EmbeddingBundle { .. } => {
DataClass::RebuildableIndex
}
Self::PreviewCache => DataClass::EphemeralCache,
}
}
}