use async_trait::async_trait;
use bytes::Bytes;
use chrono::{DateTime, Utc};
use crate::storage_error::StorageError;
pub struct ObjectWithMeta {
pub bytes: Bytes,
pub e_tag: Option<String>,
pub last_modified: DateTime<Utc>,
}
#[async_trait]
pub trait Storage {
async fn get(&self, key: &str) -> Result<Bytes, StorageError>;
async fn get_with_meta(&self, key: &str) -> Result<ObjectWithMeta, StorageError>;
async fn put(&self, key: &str, object: Bytes) -> Result<(), StorageError>;
async fn put_overwrite(&self, key: &str, object: Bytes) -> Result<(), StorageError>;
async fn delete(&self, key: &str) -> Result<(), StorageError>;
async fn exists(&self, key: &str) -> Result<bool, StorageError>;
async fn list(&self, prefix: &str) -> Result<Vec<String>, StorageError>;
}