diff --git a/ecstore/src/bucket/mod.rs b/ecstore/src/bucket/mod.rs index 914b8deaf..ac07a6e30 100644 --- a/ecstore/src/bucket/mod.rs +++ b/ecstore/src/bucket/mod.rs @@ -7,4 +7,5 @@ mod policy; mod quota; mod replication; mod tags; +mod target; mod versioning; diff --git a/ecstore/src/bucket/target/mod.rs b/ecstore/src/bucket/target/mod.rs new file mode 100644 index 000000000..c2f2aecfd --- /dev/null +++ b/ecstore/src/bucket/target/mod.rs @@ -0,0 +1,100 @@ +use time::OffsetDateTime; + +#[derive(Debug)] +pub struct Credentials { + access_key: String, + secret_key: String, + session_token: Option, + expiration: Option, +} + +#[derive(Debug)] +pub enum ServiceType { + Replication, +} + +// pub struct LatencyStat { +// curr: Duration, // 当前延迟 +// avg: Duration, // 平均延迟 +// max: Duration, // 最大延迟 +// } + +// #[derive(Serialize, Deserialize, Debug)] +// pub struct LatencyStat { +// curr: Duration, +// avg: Duration, +// max: Duration, +// } + +// // 定义BucketTarget结构体 +// #[derive(Serialize, Deserialize, Debug)] +// pub struct BucketTarget { +// #[serde(rename = "sourcebucket")] +// source_bucket: String, + +// #[serde(rename = "endpoint")] +// endpoint: String, + +// #[serde(rename = "credentials")] +// credentials: Option, + +// #[serde(rename = "targetbucket")] +// target_bucket: String, + +// #[serde(rename = "secure")] +// secure: bool, + +// #[serde(rename = "path", skip_serializing_if = "Option::is_none")] +// path: Option, + +// #[serde(rename = "api", skip_serializing_if = "Option::is_none")] +// api: Option, + +// #[serde(rename = "arn", skip_serializing_if = "Option::is_none")] +// arn: Option, + +// #[serde(rename = "type")] +// type_: ServiceType, + +// #[serde(rename = "region", skip_serializing_if = "Option::is_none")] +// region: Option, + +// #[serde(rename = "bandwidthlimit")] +// bandwidth_limit: Option, + +// #[serde(rename = "replicationSync")] +// replication_sync: bool, + +// #[serde(rename = "storageclass", skip_serializing_if = "Option::is_none")] +// storage_class: Option, + +// #[serde(rename = "healthCheckDuration")] +// health_check_duration: Option, + +// #[serde(rename = "disableProxy")] +// disable_proxy: bool, + +// #[serde(rename = "resetBeforeDate", skip_serializing_if = "Option::is_none")] +// reset_before_date: Option, + +// #[serde(rename = "resetID", skip_serializing_if = "Option::is_none")] +// reset_id: Option, + +// #[serde(rename = "totalDowntime")] +// total_downtime: Duration, + +// #[serde(rename = "lastOnline")] +// last_online: SystemTime, + +// #[serde(rename = "isOnline")] +// online: bool, + +// #[serde(rename = "latency")] +// latency: LatencyStat, + +// #[serde(rename = "deploymentID", skip_serializing_if = "Option::is_none")] +// deployment_id: Option, + +// #[serde(rename = "edge")] +// edge: bool, +// }