use std::future::Future;
use bytes::Bytes;
use crate::error::Error;
use crate::types::{PutOptions, RawDownloadResult};
pub trait StorageBackend: Send + Sync {
fn put_object(
&self,
key: &str,
data: Bytes,
content_type: &str,
options: &PutOptions,
) -> impl Future<Output = Result<(), Error>> + Send;
fn get_object(
&self,
key: &str,
) -> impl Future<Output = Result<RawDownloadResult, Error>> + Send;
fn delete_object(&self, key: &str) -> impl Future<Output = Result<(), Error>> + Send;
fn exists(&self, key: &str) -> impl Future<Output = Result<bool, Error>> + Send;
fn presigned_get_url(
&self,
key: &str,
expires_in_secs: u64,
) -> impl Future<Output = Result<String, Error>> + Send;
fn presigned_put_url(
&self,
key: &str,
content_type: &str,
expires_in_secs: u64,
) -> impl Future<Output = Result<String, Error>> + Send;
fn public_url(&self, key: &str) -> String;
fn test_connection(&self) -> impl Future<Output = Result<(), Error>> + Send;
}