mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-19 02:56:18 +00:00
todo:put_object
This commit is contained in:
@@ -1,9 +1,39 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use anyhow::Result;
|
||||
use bytes::Bytes;
|
||||
use futures::Stream;
|
||||
|
||||
pub struct MakeBucketOptions {}
|
||||
use crate::stream::DynByteStream;
|
||||
|
||||
pub struct MakeBucketOptions {
|
||||
pub force_create: bool,
|
||||
}
|
||||
|
||||
pub struct PutObjReader {
|
||||
// pub stream: Box<dyn Stream<Item = Bytes>>,
|
||||
}
|
||||
|
||||
// impl PutObjReader {
|
||||
// pub fn new<S: Stream>(stream: S) -> Self {
|
||||
// PutObjReader { stream }
|
||||
// }
|
||||
// }
|
||||
|
||||
pub struct ObjectOptions {
|
||||
// Use the maximum parity (N/2), used when saving server configuration files
|
||||
pub max_parity: bool,
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
pub trait StorageAPI {
|
||||
async fn make_bucket(&self, bucket: &str, opts: &MakeBucketOptions) -> Result<()>;
|
||||
|
||||
async fn put_object(&self, bucket: &str, objcet: &str) -> Result<()>;
|
||||
async fn put_object(
|
||||
&self,
|
||||
bucket: &str,
|
||||
object: &str,
|
||||
data: &PutObjReader,
|
||||
opts: &ObjectOptions,
|
||||
) -> Result<()>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user