init bucketmeta struct

This commit is contained in:
weisd
2024-09-27 17:53:44 +08:00
parent b4f8088f0f
commit dfb4c9f726
21 changed files with 335 additions and 19 deletions
+8
View File
@@ -0,0 +1,8 @@
use super::tag::Tag;
// 定义And结构体
#[derive(Debug)]
pub struct And {
prefix: Option<String>,
tags: Option<Vec<Tag>>,
}
+11
View File
@@ -0,0 +1,11 @@
use super::and::And;
use super::tag::Tag;
use std::collections::HashMap;
#[derive(Debug)]
pub struct Filter {
prefix: String,
and: And,
tag: Tag,
cached_tags: HashMap<String, String>,
}
+12
View File
@@ -0,0 +1,12 @@
use rule::Rule;
mod and;
mod filter;
mod rule;
mod tag;
#[derive(Debug)]
pub struct Config {
rules: Vec<Rule>,
role_arn: String,
}
+54
View File
@@ -0,0 +1,54 @@
use super::filter::Filter;
#[derive(Debug)]
pub enum Status {
Enabled,
Disabled,
}
#[derive(Debug)]
pub struct DeleteMarkerReplication {
pub status: Status,
}
#[derive(Debug)]
pub struct DeleteReplication {
pub status: Status,
}
#[derive(Debug)]
pub struct ExistingObjectReplication {
pub status: Status,
}
#[derive(Debug)]
pub struct Destination {
pub bucket: String,
pub storage_class: String,
pub arn: String,
}
// 定义ReplicaModifications结构体
#[derive(Debug)]
pub struct ReplicaModifications {
status: Status,
}
// 定义SourceSelectionCriteria结构体
#[derive(Debug)]
pub struct SourceSelectionCriteria {
replica_modifications: ReplicaModifications,
}
#[derive(Debug)]
pub struct Rule {
pub id: String,
pub status: Status,
pub priority: usize,
pub delete_marker_replication: DeleteMarkerReplication,
pub delete_replication: DeleteReplication,
pub destination: Destination,
pub source_selection_criteria: SourceSelectionCriteria,
pub filter: Filter,
pub existing_object_replication: ExistingObjectReplication,
}
+5
View File
@@ -0,0 +1,5 @@
#[derive(Debug)]
pub struct Tag {
pub key: Option<String>,
pub value: Option<String>,
}