mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-20 19:42:17 +00:00
init bucketmeta struct
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
use super::tag::Tag;
|
||||
|
||||
// 定义And结构体
|
||||
#[derive(Debug)]
|
||||
pub struct And {
|
||||
prefix: Option<String>,
|
||||
tags: Option<Vec<Tag>>,
|
||||
}
|
||||
@@ -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>,
|
||||
}
|
||||
@@ -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,
|
||||
}
|
||||
@@ -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,
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
#[derive(Debug)]
|
||||
pub struct Tag {
|
||||
pub key: Option<String>,
|
||||
pub value: Option<String>,
|
||||
}
|
||||
Reference in New Issue
Block a user