-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
132 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use std::fmt::Display; | ||
use std::fmt::Formatter; | ||
|
||
use serde::Deserialize; | ||
use serde::Serialize; | ||
|
||
#[derive(Clone, Default, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)] | ||
pub struct AzureConfig { | ||
pub storage_account: Option<String>, | ||
pub access_key: Option<String>, | ||
pub anonymous: bool, | ||
} | ||
|
||
impl Display for AzureConfig { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> std::result::Result<(), std::fmt::Error> { | ||
write!( | ||
f, | ||
"AzureConfig | ||
storage_account: {:?} | ||
access_key: {:?} | ||
anonymous: {:?}", | ||
self.storage_account, self.access_key, self.anonymous | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use std::fmt::Display; | ||
use std::fmt::Formatter; | ||
|
||
use serde::Deserialize; | ||
use serde::Serialize; | ||
|
||
#[derive(Clone, Default, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)] | ||
pub struct GCSConfig { | ||
pub project_id: Option<String>, | ||
pub anonymous: bool, | ||
} | ||
|
||
impl Display for GCSConfig { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> std::result::Result<(), std::fmt::Error> { | ||
write!( | ||
f, | ||
"GCSConfig | ||
project_id: {:?} | ||
anonymous: {:?}", | ||
self.project_id, self.anonymous | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
#[cfg(feature = "python")] | ||
pub mod python; | ||
|
||
pub mod config; | ||
mod azure; | ||
mod config; | ||
mod gcs; | ||
mod s3; | ||
|
||
pub use config::{AzureConfig, GCSConfig, IOConfig, S3Config}; | ||
pub use crate::{azure::AzureConfig, config::IOConfig, gcs::GCSConfig, s3::S3Config}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
use std::fmt::Display; | ||
use std::fmt::Formatter; | ||
|
||
use serde::Deserialize; | ||
use serde::Serialize; | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)] | ||
pub struct S3Config { | ||
pub region_name: Option<String>, | ||
pub endpoint_url: Option<String>, | ||
pub key_id: Option<String>, | ||
pub session_token: Option<String>, | ||
pub access_key: Option<String>, | ||
pub retry_initial_backoff_ms: u64, | ||
pub connect_timeout_ms: u64, | ||
pub read_timeout_ms: u64, | ||
pub num_tries: u32, | ||
pub retry_mode: Option<String>, | ||
pub anonymous: bool, | ||
} | ||
|
||
impl Default for S3Config { | ||
fn default() -> Self { | ||
S3Config { | ||
region_name: None, | ||
endpoint_url: None, | ||
key_id: None, | ||
session_token: None, | ||
access_key: None, | ||
retry_initial_backoff_ms: 1000, | ||
connect_timeout_ms: 60_000, | ||
read_timeout_ms: 60_000, | ||
num_tries: 5, | ||
retry_mode: Some("standard".to_string()), | ||
anonymous: false, | ||
} | ||
} | ||
} | ||
|
||
impl Display for S3Config { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> std::result::Result<(), std::fmt::Error> { | ||
write!( | ||
f, | ||
"S3Config | ||
region_name: {:?} | ||
endpoint_url: {:?} | ||
key_id: {:?} | ||
session_token: {:?}, | ||
access_key: {:?} | ||
retry_initial_backoff_ms: {}, | ||
connect_timeout_ms: {}, | ||
read_timeout_ms: {}, | ||
num_tries: {:?}, | ||
retry_mode: {:?}, | ||
anonymous: {}", | ||
self.region_name, | ||
self.endpoint_url, | ||
self.key_id, | ||
self.session_token, | ||
self.access_key, | ||
self.retry_initial_backoff_ms, | ||
self.connect_timeout_ms, | ||
self.read_timeout_ms, | ||
self.num_tries, | ||
self.retry_mode, | ||
self.anonymous | ||
) | ||
} | ||
} |