add delete_bucket opts

This commit is contained in:
weisd
2024-09-13 13:30:10 +08:00
parent dc6f485aca
commit 7f35685b35
7 changed files with 66 additions and 20 deletions
+5 -1
View File
@@ -243,6 +243,10 @@ pub struct MakeBucketOptions {
pub force_create: bool,
}
pub struct DeleteBucketOptions {
pub force: bool, // Force deletion
}
#[derive(Debug)]
pub struct PutObjReader {
pub stream: StreamingBlob,
@@ -488,7 +492,7 @@ pub struct DeletedObject {
#[async_trait::async_trait]
pub trait StorageAPI {
async fn make_bucket(&self, bucket: &str, opts: &MakeBucketOptions) -> Result<()>;
async fn delete_bucket(&self, bucket: &str) -> Result<()>;
async fn delete_bucket(&self, bucket: &str, opts: &DeleteBucketOptions) -> Result<()>;
async fn list_bucket(&self, opts: &BucketOptions) -> Result<Vec<BucketInfo>>;
async fn get_bucket_info(&self, bucket: &str, opts: &BucketOptions) -> Result<BucketInfo>;
async fn delete_object(&self, bucket: &str, object: &str, opts: ObjectOptions) -> Result<ObjectInfo>;