pub mod index;
pub mod local;
pub mod s3;
pub use index::StorageIndex;
pub use local::LocalStorage;
pub use s3::S3Storage;
use async_trait::async_trait;
use crate::CacheError;
#[async_trait]
pub trait StorageBackend: Send + Sync {
async fn get_narinfo(&self, hash: &str) -> Result<Option<String>, CacheError>;
async fn put_narinfo(&self, hash: &str, content: &str) -> Result<(), CacheError>;
async fn get_nar(&self, path: &str) -> Result<Option<Vec<u8>>, CacheError>;
async fn put_nar(&self, path: &str, data: &[u8]) -> Result<(), CacheError>;
async fn delete(&self, hash: &str) -> Result<(), CacheError>;
async fn list_narinfos(&self) -> Result<Vec<String>, CacheError>;
}