This commit is contained in:
2025-10-11 14:39:58 +02:00
parent 6f6abef5d2
commit cd27f36e3d
12 changed files with 616 additions and 12 deletions
+13
View File
@@ -18,6 +18,8 @@ pub trait ObjectStorage: Send + Sync + 'static {
async fn presign_get_object(&self, key: &str, expires_in: Duration) -> Result<String>;
async fn get_object(&self, key: &str) -> Result<Vec<u8>>;
async fn delete_object(&self, key: &str) -> Result<()>;
}
pub struct S3Storage {
@@ -99,4 +101,15 @@ impl ObjectStorage for S3Storage {
Ok(bytes)
}
async fn delete_object(&self, key: &str) -> Result<()> {
self.client
.delete_object()
.bucket(&self.bucket)
.key(key)
.send()
.await
.context("failed to delete object from S3")?;
Ok(())
}
}