Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Google Cloud Storage support skeleton #513

Merged
merged 17 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ quick-xml = { version = "0.23", features = ["serialize"] }
radix_trie = { version = "0.2", optional = true }
reqsign = "0.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0"
time = "0.3"
tokio = { version = "1.20", features = ["fs"] }
Expand Down
1 change: 1 addition & 0 deletions src/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ impl Operator {
#[cfg(feature = "services-http")]
Scheme::Http => services::http::Backend::from_iter(it)?.into(),
Scheme::Memory => services::memory::Builder::default().build()?.into(),
Scheme::Gcs => services::gcs::Backend::from_iter(it)?.into(),
Scheme::S3 => services::s3::Backend::from_iter(it)?.into(),
};

Expand Down
7 changes: 6 additions & 1 deletion src/scheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::error::other;
use crate::error::BackendError;

/// Backends that OpenDAL supports
#[derive(Copy, Clone, Debug, PartialEq)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum Scheme {
/// [azblob][crate::services::azblob]: Azure Storage Blob services.
Azblob,
Expand All @@ -34,6 +34,8 @@ pub enum Scheme {
/// [http][crate::services::http]: HTTP backend.
#[cfg(feature = "services-http")]
Http,
/// [gcs][crate::services::gcs]: Google Cloud Storage backend.
Gcs,
/// [memory][crate::services::memory]: In memory backend support.
Memory,
/// [s3][crate::services::s3]: AWS S3 alike services.
Expand All @@ -60,6 +62,7 @@ impl Display for Scheme {
Scheme::Fs => write!(f, "fs"),
#[cfg(feature = "services-hdfs")]
Scheme::Hdfs => write!(f, "hdfs"),
Scheme::Gcs => write!(f, "gcs"),
ClSlaid marked this conversation as resolved.
Show resolved Hide resolved
#[cfg(feature = "services-http")]
Scheme::Http => write!(f, "http"),
Scheme::Memory => write!(f, "memory"),
Expand All @@ -80,6 +83,7 @@ impl FromStr for Scheme {
"hdfs" => Ok(Scheme::Hdfs),
#[cfg(feature = "services-http")]
"http" | "https" => Ok(Scheme::Http),
"gcs" => Ok(Scheme::Gcs),
Xuanwo marked this conversation as resolved.
Show resolved Hide resolved
"memory" => Ok(Scheme::Memory),
"s3" => Ok(Scheme::S3),
v => Err(other(BackendError::new(
Expand All @@ -99,6 +103,7 @@ impl From<Scheme> for &'static str {
Scheme::Hdfs => "hdfs",
#[cfg(feature = "services-http")]
Scheme::Http => "http",
Scheme::Gcs => "gcs",
Scheme::Memory => "memory",
Scheme::S3 => "s3",
}
Expand Down
Loading