Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b6127f6a6
|
||
|
|
8464401337
|
||
|
|
7db41e190e
|
||
|
|
966aad363b
|
Generated
+1
-1
@@ -1370,7 +1370,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "labyrinth"
|
||||
version = "0.0.3"
|
||||
version = "0.0.2"
|
||||
dependencies = [
|
||||
"aws-config",
|
||||
"aws-sdk-s3",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "labyrinth"
|
||||
version = "0.0.3"
|
||||
version = "0.0.2"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
description = "Library for managing soaricarus storage"
|
||||
|
||||
-21
@@ -47,7 +47,6 @@ pub enum Error {
|
||||
}
|
||||
|
||||
impl Labyrinth {
|
||||
/// Upload object to the bucket
|
||||
pub async fn upload(
|
||||
&self,
|
||||
file_key: &str,
|
||||
@@ -78,7 +77,6 @@ impl Labyrinth {
|
||||
}
|
||||
}
|
||||
|
||||
/// Download object from the bucket
|
||||
pub async fn download(&self, file_key: &str) -> Result<Vec<u8>, Error> {
|
||||
let client = init_client(&self.config).await;
|
||||
|
||||
@@ -105,23 +103,4 @@ impl Labyrinth {
|
||||
Err(err) => Err(Error::Info(err.to_string())),
|
||||
}
|
||||
}
|
||||
|
||||
/// Delete an object from the bucket
|
||||
pub async fn delete(
|
||||
&self,
|
||||
file_key: &str,
|
||||
) -> Result<aws_sdk_s3::operation::delete_object::DeleteObjectOutput, Error> {
|
||||
let client = init_client(&self.config).await;
|
||||
|
||||
match client
|
||||
.delete_object()
|
||||
.bucket(self.config.bucket.clone())
|
||||
.key(file_key)
|
||||
.send()
|
||||
.await
|
||||
{
|
||||
Ok(response) => Ok(response),
|
||||
Err(err) => Err(Error::Info(err.to_string())),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user