Skip to content

Commit

Permalink
Add Ovh regions, closes #232
Browse files Browse the repository at this point in the history
  • Loading branch information
durch committed Sep 6, 2024
1 parent 8f79ea9 commit 03fd2cf
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion aws-region/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aws-region"
version = "0.26.0"
version = "0.27.0"
authors = ["Drazen Urch"]
description = "Tiny Rust library for working with Amazon AWS regions, supports `s3` crate"
repository = "https://github.com/durch/rust-s3"
Expand Down
36 changes: 36 additions & 0 deletions aws-region/src/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ pub enum Region {
/// Digital Ocean fra1
DoFra1,
/// Yandex Object Storage
OvhGra,
/// gra
OvhRbx,
/// rbx
OvhSbg,
/// sbg
OvhDe,
/// de
OvhUk,
/// uk
OvhWaw,
/// waw
OvhBhs,
/// bhs
OvhCaEastTor,
/// ca-east-tor
OvhSgp,
/// sgp
Yandex,
/// Wasabi us-east-1
WaUsEast1,
Expand Down Expand Up @@ -171,6 +189,15 @@ impl fmt::Display for Region {
WaApNortheast2 => write!(f, "ap-northeast-2"),
WaApSoutheast1 => write!(f, "ap-southeast-1"),
WaApSoutheast2 => write!(f, "ap-southeast-2"),
OvhGra => write!(f, "gra"),
OvhRbx => write!(f, "rbx"),
OvhSbg => write!(f, "sbg"),
OvhDe => write!(f, "de"),
OvhUk => write!(f, "uk"),
OvhWaw => write!(f, "waw"),
OvhBhs => write!(f, "bhs"),
OvhCaEastTor => write!(f, "ca-east-tor"),
OvhSgp => write!(f, "sgp"),
R2 { .. } => write!(f, "auto"),
Custom { ref region, .. } => write!(f, "{}", region),
}
Expand Down Expand Up @@ -282,6 +309,15 @@ impl Region {
WaApNortheast2 => String::from("s3.ap-northeast-2.wasabisys.com"),
WaApSoutheast1 => String::from("s3.ap-southeast-1.wasabisys.com"),
WaApSoutheast2 => String::from("s3.ap-southeast-2.wasabisys.com"),
OvhGra => String::from("s3.gra.io.cloud.ovh.net"),
OvhRbx => String::from("s3.rbx.io.cloud.ovh.net"),
OvhSbg => String::from("s3.sbg.io.cloud.ovh.net"),
OvhDe => String::from("s3.de.io.cloud.ovh.net"),
OvhUk => String::from("s3.uk.io.cloud.ovh.net"),
OvhWaw => String::from("s3.waw.io.cloud.ovh.net"),
OvhBhs => String::from("s3.bhs.io.cloud.ovh.net"),
OvhCaEastTor => String::from("s3.ca-east-tor.io.cloud.ovh.net"),
OvhSgp => String::from("s3.sgp.io.cloud.ovh.net"),
R2 { ref account_id } => format!("{}.r2.cloudflarestorage.com", account_id),
Custom { ref endpoint, .. } => endpoint.to_string(),
}
Expand Down

0 comments on commit 03fd2cf

Please sign in to comment.