use crate::{Result, StorageClient};
#[derive(Debug, Clone)]
pub struct MultipartUpload {
pub upload_id: String,
pub bucket: String,
pub key: String,
}
impl StorageClient {
pub async fn create_multipart_upload(
&self,
bucket: &str,
key: &str,
) -> Result<MultipartUpload> {
Ok(MultipartUpload {
upload_id: uuid::Uuid::new_v4().to_string(),
bucket: bucket.to_string(),
key: key.to_string(),
})
}
pub async fn upload_part(
&self,
bucket: &str,
key: &str,
upload_id: &str,
part_number: i32,
body: Vec<u8>,
) -> Result<String> {
Ok("part-etag".to_string())
}
pub async fn complete_multipart_upload(
&self,
bucket: &str,
key: &str,
upload_id: &str,
parts: Vec<(i32, String)>, ) -> Result<()> {
Ok(())
}
pub async fn abort_multipart_upload(
&self,
bucket: &str,
key: &str,
upload_id: &str,
) -> Result<()> {
Ok(())
}
}