23 lines
631 B
Rust
23 lines
631 B
Rust
pub mod aws;
|
|||
|
|
pub mod azure;
|
||
|
|
|
||
|
|
use async_trait::async_trait;
|
||
|
|
|
||
|
|
#[async_trait]
|
||
|
|
pub trait ObjectStorageClient {
|
||
|
|
type Error;
|
||
|
|
|
||
|
|
async fn put_object(&self, bucket: &str, key: &str, data: Vec<u8>) -> Result<(), Self::Error>;
|
||
|
|
|
||
|
|
async fn get_object(&self, bucket: &str, key: &str) -> Result<Vec<u8>, Self::Error>;
|
||
|
|
|
||
|
|
async fn delete_object(&self, bucket: &str, key: &str) -> Result<(), Self::Error>;
|
||
|
|
|
||
|
|
async fn list_objects(
|
||
|
|
&self,
|
||
|
|
bucket: &str,
|
||
|
|
prefix: Option<&str>,
|
||
|
|
) -> Result<Vec<String>, Self::Error>;
|
||
|
|
|
||
|
|
async fn object_exists(&self, bucket: &str, key: &str) -> Result<bool, Self::Error>;
|
||
|
|
}
|