mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-31 01:09:24 +00:00
rename Condition into RedirectCondition in internal model
This commit is contained in:
@@ -246,9 +246,11 @@ impl WebsiteConfiguration {
|
|||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|rule| {
|
.map(|rule| {
|
||||||
bucket_table::RoutingRule {
|
bucket_table::RoutingRule {
|
||||||
condition: rule.condition.map(|condition| bucket_table::Condition {
|
condition: rule.condition.map(|condition| {
|
||||||
http_error_code: condition.http_error_code.map(|c| c.0 as u16),
|
bucket_table::RedirectCondition {
|
||||||
prefix: condition.prefix.map(|p| p.0),
|
http_error_code: condition.http_error_code.map(|c| c.0 as u16),
|
||||||
|
prefix: condition.prefix.map(|p| p.0),
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
redirect: bucket_table::Redirect {
|
redirect: bucket_table::Redirect {
|
||||||
hostname: rule.redirect.hostname.map(|h| h.0),
|
hostname: rule.redirect.hostname.map(|h| h.0),
|
||||||
|
|||||||
@@ -185,12 +185,12 @@ mod v2 {
|
|||||||
|
|
||||||
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)]
|
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct RoutingRule {
|
pub struct RoutingRule {
|
||||||
pub condition: Option<Condition>,
|
pub condition: Option<RedirectCondition>,
|
||||||
pub redirect: Redirect,
|
pub redirect: Redirect,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)]
|
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct Condition {
|
pub struct RedirectCondition {
|
||||||
pub http_error_code: Option<u16>,
|
pub http_error_code: Option<u16>,
|
||||||
pub prefix: Option<String>,
|
pub prefix: Option<String>,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user