mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-13 16:46:55 +00:00
refactor: move multipart DTO contracts (#3505)
This commit is contained in:
@@ -17,7 +17,9 @@
|
||||
pub mod admin;
|
||||
pub mod bucket;
|
||||
pub mod error;
|
||||
pub mod multipart;
|
||||
|
||||
pub use admin::{DiskSetSelector, StorageAdminApi};
|
||||
pub use bucket::{BucketInfo, BucketOptions, DeleteBucketOptions, MakeBucketOptions, SRBucketDeleteOp};
|
||||
pub use error::{StorageErrorCode, StorageResult};
|
||||
pub use multipart::{ListMultipartsInfo, ListPartsInfo, MultipartInfo, MultipartUploadResult, PartInfo};
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
// Copyright 2024 RustFS Team
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use time::OffsetDateTime;
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct MultipartUploadResult {
|
||||
pub upload_id: String,
|
||||
pub checksum_algo: Option<String>,
|
||||
pub checksum_type: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct PartInfo {
|
||||
pub part_num: usize,
|
||||
pub last_mod: Option<OffsetDateTime>,
|
||||
pub size: usize,
|
||||
pub etag: Option<String>,
|
||||
pub actual_size: i64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct MultipartInfo {
|
||||
pub bucket: String,
|
||||
pub object: String,
|
||||
pub upload_id: String,
|
||||
pub initiated: Option<OffsetDateTime>,
|
||||
pub user_defined: HashMap<String, String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct ListMultipartsInfo {
|
||||
pub key_marker: Option<String>,
|
||||
pub upload_id_marker: Option<String>,
|
||||
pub next_key_marker: Option<String>,
|
||||
pub next_upload_id_marker: Option<String>,
|
||||
pub max_uploads: usize,
|
||||
pub is_truncated: bool,
|
||||
pub uploads: Vec<MultipartInfo>,
|
||||
pub prefix: String,
|
||||
pub delimiter: Option<String>,
|
||||
pub common_prefixes: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct ListPartsInfo {
|
||||
pub bucket: String,
|
||||
pub object: String,
|
||||
pub upload_id: String,
|
||||
pub storage_class: String,
|
||||
pub part_number_marker: usize,
|
||||
pub next_part_number_marker: usize,
|
||||
pub max_parts: usize,
|
||||
pub is_truncated: bool,
|
||||
pub parts: Vec<PartInfo>,
|
||||
pub user_defined: HashMap<String, String>,
|
||||
pub checksum_algorithm: String,
|
||||
pub checksum_type: String,
|
||||
}
|
||||
Reference in New Issue
Block a user