This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new a607dc1de feat(services): split cacache, dbfs, dropbox, etcd,
foundationdb into separate crates (#7031)
a607dc1de is described below
commit a607dc1de8fab18dc8b81cb4d5d32e3f10e5c80a
Author: Jintao Zhang <[email protected]>
AuthorDate: Wed Dec 17 15:39:32 2025 +0800
feat(services): split cacache, dbfs, dropbox, etcd, foundationdb into
separate crates (#7031)
* feat(services): split cacache, dbfs, dropbox, etcd, foundationdb into
separate crates
This PR extracts the following services into their own crates:
- cacache -> opendal-service-cacache (closes #6883)
- dbfs -> opendal-service-dbfs (closes #6889)
- dropbox -> opendal-service-dropbox (closes #6890)
- etcd -> opendal-service-etcd (closes #6891)
- foundationdb -> opendal-service-foundationdb (closes #6892)
Each service is now a standalone crate under core/services/ with:
- Its own Cargo.toml with service-specific dependencies
- Re-exported through the main opendal crate via feature flags
- Registration with DEFAULT_OPERATOR_REGISTRY via ctor
The public API remains unchanged - users can still access these
services through opendal::services::{ServiceName} when the
corresponding feature flag is enabled.
* fix: remove compfs module reference and fix code formatting
* Update core/services/cacache/src/docs.md
Co-authored-by: Qinxuan Chen <[email protected]>
* Update core/core/Cargo.toml
Co-authored-by: Qinxuan Chen <[email protected]>
* Update core/core/Cargo.toml
Co-authored-by: Qinxuan Chen <[email protected]>
---------
Co-authored-by: Xuanwo <[email protected]>
Co-authored-by: Qinxuan Chen <[email protected]>
---
core/Cargo.lock | 79 +++++++++++++++++++++-
core/Cargo.toml | 15 ++--
core/core/Cargo.toml | 18 -----
core/core/src/services/mod.rs | 25 -------
core/services/cacache/Cargo.toml | 45 ++++++++++++
.../cacache => services/cacache/src}/backend.rs | 4 +-
.../cacache => services/cacache/src}/config.rs | 8 +--
.../cacache => services/cacache/src}/core.rs | 2 +-
.../cacache => services/cacache/src}/deleter.rs | 4 +-
.../cacache => services/cacache/src}/docs.md | 2 +-
.../cacache/mod.rs => services/cacache/src/lib.rs} | 11 +--
.../cacache => services/cacache/src}/writer.rs | 4 +-
core/services/dbfs/Cargo.toml | 44 ++++++++++++
.../services/dbfs => services/dbfs/src}/backend.rs | 6 +-
.../services/dbfs => services/dbfs/src}/config.rs | 8 +--
.../services/dbfs => services/dbfs/src}/core.rs | 4 +-
.../services/dbfs => services/dbfs/src}/deleter.rs | 4 +-
.../services/dbfs => services/dbfs/src}/docs.md | 0
.../services/dbfs => services/dbfs/src}/error.rs | 4 +-
.../dbfs/mod.rs => services/dbfs/src/lib.rs} | 11 +--
.../services/dbfs => services/dbfs/src}/lister.rs | 4 +-
.../services/dbfs => services/dbfs/src}/writer.rs | 4 +-
core/services/dropbox/Cargo.toml | 45 ++++++++++++
.../dropbox => services/dropbox/src}/backend.rs | 4 +-
.../dropbox => services/dropbox/src}/builder.rs | 4 +-
.../dropbox => services/dropbox/src}/config.rs | 8 +--
.../dropbox => services/dropbox/src}/core.rs | 4 +-
.../dropbox => services/dropbox/src}/deleter.rs | 4 +-
.../dropbox => services/dropbox/src}/docs.md | 0
.../dropbox => services/dropbox/src}/error.rs | 4 +-
.../dropbox/mod.rs => services/dropbox/src/lib.rs} | 11 +--
.../dropbox => services/dropbox/src}/lister.rs | 4 +-
.../dropbox => services/dropbox/src}/writer.rs | 4 +-
core/services/etcd/Cargo.toml | 44 ++++++++++++
.../services/etcd => services/etcd/src}/backend.rs | 4 +-
.../services/etcd => services/etcd/src}/config.rs | 8 +--
.../services/etcd => services/etcd/src}/core.rs | 6 +-
.../services/etcd => services/etcd/src}/deleter.rs | 6 +-
.../services/etcd => services/etcd/src}/docs.md | 0
.../services/etcd => services/etcd/src}/error.rs | 2 +-
.../etcd/mod.rs => services/etcd/src/lib.rs} | 11 +--
.../services/etcd => services/etcd/src}/lister.rs | 6 +-
.../services/etcd => services/etcd/src}/writer.rs | 4 +-
core/services/foundationdb/Cargo.toml | 46 +++++++++++++
.../foundationdb/src}/backend.rs | 4 +-
.../foundationdb/src}/config.rs | 8 +--
.../foundationdb/src}/core.rs | 2 +-
.../foundationdb/src}/deleter.rs | 6 +-
.../foundationdb/src}/docs.md | 0
.../mod.rs => services/foundationdb/src/lib.rs} | 11 +--
.../foundationdb/src}/writer.rs | 4 +-
core/src/lib.rs | 10 +++
52 files changed, 432 insertions(+), 148 deletions(-)
diff --git a/core/Cargo.lock b/core/Cargo.lock
index 20c027cb8..36c854b45 100644
--- a/core/Cargo.lock
+++ b/core/Cargo.lock
@@ -5557,11 +5557,16 @@ dependencies = [
"opendal-service-azdls",
"opendal-service-azfile",
"opendal-service-b2",
+ "opendal-service-cacache",
"opendal-service-cloudflare-kv",
"opendal-service-compfs",
"opendal-service-cos",
"opendal-service-d1",
"opendal-service-dashmap",
+ "opendal-service-dbfs",
+ "opendal-service-dropbox",
+ "opendal-service-etcd",
+ "opendal-service-foundationdb",
"opendal-service-fs",
"opendal-service-ftp",
"opendal-service-gcs",
@@ -5634,14 +5639,12 @@ dependencies = [
"backon",
"base64 0.22.1",
"bytes",
- "cacache",
+ "compio",
"criterion",
"ctor",
"divan",
- "etcd-client",
"fastpool",
"flume",
- "foundationdb",
"futures",
"getrandom 0.2.16",
"hdfs-native",
@@ -5972,6 +5975,19 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "opendal-service-cacache"
+version = "0.55.0"
+dependencies = [
+ "bytes",
+ "cacache",
+ "ctor",
+ "log",
+ "opendal-core",
+ "serde",
+ "tokio",
+]
+
[[package]]
name = "opendal-service-cloudflare-kv"
version = "0.55.0"
@@ -6041,6 +6057,63 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "opendal-service-dbfs"
+version = "0.55.0"
+dependencies = [
+ "base64 0.22.1",
+ "bytes",
+ "ctor",
+ "http 1.4.0",
+ "log",
+ "opendal-core",
+ "serde",
+ "serde_json",
+ "tokio",
+]
+
+[[package]]
+name = "opendal-service-dropbox"
+version = "0.55.0"
+dependencies = [
+ "bytes",
+ "ctor",
+ "http 1.4.0",
+ "log",
+ "mea",
+ "opendal-core",
+ "serde",
+ "serde_json",
+ "tokio",
+]
+
+[[package]]
+name = "opendal-service-etcd"
+version = "0.55.0"
+dependencies = [
+ "bytes",
+ "ctor",
+ "etcd-client",
+ "fastpool",
+ "log",
+ "opendal-core",
+ "serde",
+ "tokio",
+]
+
+[[package]]
+name = "opendal-service-foundationdb"
+version = "0.55.0"
+dependencies = [
+ "bytes",
+ "ctor",
+ "foundationdb",
+ "log",
+ "opendal-core",
+ "serde",
+ "tokio",
+]
+
[[package]]
name = "opendal-service-fs"
version = "0.55.0"
diff --git a/core/Cargo.toml b/core/Cargo.toml
index f7fbc8d91..d3bfbae2e 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -107,16 +107,16 @@ services-azblob = ["dep:opendal-service-azblob"]
services-azdls = ["dep:opendal-service-azdls"]
services-azfile = ["dep:opendal-service-azfile"]
services-b2 = ["dep:opendal-service-b2"]
-services-cacache = ["opendal-core/services-cacache"]
+services-cacache = ["dep:opendal-service-cacache"]
services-cloudflare-kv = ["dep:opendal-service-cloudflare-kv"]
services-compfs = ["dep:opendal-service-compfs"]
services-cos = ["dep:opendal-service-cos"]
services-d1 = ["dep:opendal-service-d1"]
services-dashmap = ["dep:opendal-service-dashmap"]
-services-dbfs = ["opendal-core/services-dbfs"]
-services-dropbox = ["opendal-core/services-dropbox"]
-services-etcd = ["opendal-core/services-etcd"]
-services-foundationdb = ["opendal-core/services-foundationdb"]
+services-dbfs = ["dep:opendal-service-dbfs"]
+services-dropbox = ["dep:opendal-service-dropbox"]
+services-etcd = ["dep:opendal-service-etcd"]
+services-foundationdb = ["dep:opendal-service-foundationdb"]
services-fs = ["dep:opendal-service-fs"]
services-ftp = ["dep:opendal-service-ftp"]
services-gcs = ["dep:opendal-service-gcs"]
@@ -209,11 +209,16 @@ opendal-service-azblob = { path = "services/azblob",
version = "0.55.0", optiona
opendal-service-azdls = { path = "services/azdls", version = "0.55.0",
optional = true, default-features = false }
opendal-service-azfile = { path = "services/azfile", version = "0.55.0",
optional = true, default-features = false }
opendal-service-b2 = { path = "services/b2", version = "0.55.0", optional =
true, default-features = false }
+opendal-service-cacache = { path = "services/cacache", version = "0.55.0",
optional = true, default-features = false }
opendal-service-cloudflare-kv = { path = "services/cloudflare-kv", version =
"0.55.0", optional = true, default-features = false }
opendal-service-compfs = { path = "services/compfs", version = "0.55.0",
optional = true, default-features = false }
opendal-service-cos = { path = "services/cos", version = "0.55.0", optional =
true, default-features = false }
opendal-service-d1 = { path = "services/d1", version = "0.55.0", optional =
true, default-features = false }
opendal-service-dashmap = { path = "services/dashmap", version = "0.55.0",
optional = true, default-features = false }
+opendal-service-dbfs = { path = "services/dbfs", version = "0.55.0", optional
= true, default-features = false }
+opendal-service-dropbox = { path = "services/dropbox", version = "0.55.0",
optional = true, default-features = false }
+opendal-service-etcd = { path = "services/etcd", version = "0.55.0", optional
= true, default-features = false }
+opendal-service-foundationdb = { path = "services/foundationdb", version =
"0.55.0", optional = true, default-features = false }
opendal-service-fs = { path = "services/fs", version = "0.55.0", optional =
true, default-features = false }
opendal-service-ftp = { path = "services/ftp", version = "0.55.0", optional =
true, default-features = false }
opendal-service-gcs = { path = "services/gcs", version = "0.55.0", optional =
true, default-features = false }
diff --git a/core/core/Cargo.toml b/core/core/Cargo.toml
index 61f8e867d..732cae0cc 100644
--- a/core/core/Cargo.toml
+++ b/core/core/Cargo.toml
@@ -57,11 +57,6 @@ executors-tokio = ["tokio/rt"]
# Enable dtrace support.
layers-dtrace = ["dep:probe"]
-services-cacache = ["dep:cacache"]
-services-dbfs = []
-services-dropbox = []
-services-etcd = ["dep:etcd-client", "dep:fastpool"]
-services-foundationdb = ["dep:foundationdb"]
services-gdrive = ["internal-path-cache"]
services-gridfs = ["dep:mongodb", "dep:mongodb-internal-macros"]
services-hdfs = ["dep:hdrs"]
@@ -131,19 +126,6 @@ sha2 = { workspace = true, optional = true }
# For http based services.
reqsign = { workspace = true, default-features = false, optional = true }
-# for self-referencing structs
-# for services-cacache
-cacache = { version = "13.0", default-features = false, features = [
- "tokio-runtime",
- "mmap",
-], optional = true }
-# for services-etcd
-etcd-client = { version = "0.17", optional = true, features = ["tls"] }
-# for services-foundationdb
-foundationdb = { version = "0.9.0", features = [
- "embedded-fdb-include",
- "fdb-7_3",
-], optional = true }
# for services-hdfs
hdrs = { version = "0.3.2", optional = true, features = ["async_file"] }
# for services-upyun
diff --git a/core/core/src/services/mod.rs b/core/core/src/services/mod.rs
index 0dbe71d44..a5a2d69cf 100644
--- a/core/core/src/services/mod.rs
+++ b/core/core/src/services/mod.rs
@@ -19,31 +19,6 @@
//!
//! More ongoing services support is tracked at
[opendal#5](https://github.com/apache/opendal/issues/5). Please feel free to
submit issues if there are services not covered.
-#[cfg(feature = "services-cacache")]
-mod cacache;
-#[cfg(feature = "services-cacache")]
-pub use self::cacache::*;
-
-#[cfg(feature = "services-dbfs")]
-mod dbfs;
-#[cfg(feature = "services-dbfs")]
-pub use self::dbfs::*;
-
-#[cfg(feature = "services-dropbox")]
-mod dropbox;
-#[cfg(feature = "services-dropbox")]
-pub use dropbox::*;
-
-#[cfg(feature = "services-etcd")]
-mod etcd;
-#[cfg(feature = "services-etcd")]
-pub use self::etcd::*;
-
-#[cfg(feature = "services-foundationdb")]
-mod foundationdb;
-#[cfg(feature = "services-foundationdb")]
-pub use self::foundationdb::*;
-
#[cfg(feature = "services-gdrive")]
mod gdrive;
#[cfg(feature = "services-gdrive")]
diff --git a/core/services/cacache/Cargo.toml b/core/services/cacache/Cargo.toml
new file mode 100644
index 000000000..1647e5c4d
--- /dev/null
+++ b/core/services/cacache/Cargo.toml
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]
+description = "Apache OpenDAL Cacache service implementation"
+name = "opendal-service-cacache"
+
+authors = { workspace = true }
+edition = { workspace = true }
+homepage = { workspace = true }
+license = { workspace = true }
+repository = { workspace = true }
+rust-version = { workspace = true }
+version = { workspace = true }
+
+[package.metadata.docs.rs]
+all-features = true
+
+[dependencies]
+bytes = { workspace = true }
+cacache = { version = "13.0", default-features = false, features = [
+ "tokio-runtime",
+ "mmap",
+] }
+ctor = { workspace = true }
+log = { workspace = true }
+opendal-core = { path = "../../core", version = "0.55.0", default-features =
false }
+serde = { workspace = true, features = ["derive"] }
+
+[dev-dependencies]
+tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
diff --git a/core/core/src/services/cacache/backend.rs
b/core/services/cacache/src/backend.rs
similarity index 98%
rename from core/core/src/services/cacache/backend.rs
rename to core/services/cacache/src/backend.rs
index 810ee8b79..277686174 100644
--- a/core/core/src/services/cacache/backend.rs
+++ b/core/services/cacache/src/backend.rs
@@ -22,8 +22,8 @@ use super::config::CacacheConfig;
use super::core::CacacheCore;
use super::deleter::CacacheDeleter;
use super::writer::CacacheWriter;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
/// cacache service support.
#[doc = include_str!("docs.md")]
diff --git a/core/core/src/services/cacache/config.rs
b/core/services/cacache/src/config.rs
similarity index 91%
rename from core/core/src/services/cacache/config.rs
rename to core/services/cacache/src/config.rs
index 8a48df903..30e7b0603 100644
--- a/core/core/src/services/cacache/config.rs
+++ b/core/services/cacache/src/config.rs
@@ -27,9 +27,9 @@ pub struct CacacheConfig {
pub datadir: Option<String>,
}
-impl crate::Configurator for CacacheConfig {
+impl opendal_core::Configurator for CacacheConfig {
type Builder = CacacheBuilder;
- fn from_uri(uri: &crate::types::OperatorUri) -> crate::Result<Self> {
+ fn from_uri(uri: &opendal_core::OperatorUri) -> opendal_core::Result<Self>
{
let mut map = uri.options().clone();
if let Some(root) = uri.root() {
@@ -50,8 +50,8 @@ impl crate::Configurator for CacacheConfig {
#[cfg(test)]
mod tests {
use super::*;
- use crate::Configurator;
- use crate::types::OperatorUri;
+ use opendal_core::Configurator;
+ use opendal_core::OperatorUri;
#[test]
fn from_uri_sets_datadir_from_authority() {
diff --git a/core/core/src/services/cacache/core.rs
b/core/services/cacache/src/core.rs
similarity index 99%
rename from core/core/src/services/cacache/core.rs
rename to core/services/cacache/src/core.rs
index a7cfed059..bb0b8d220 100644
--- a/core/core/src/services/cacache/core.rs
+++ b/core/services/cacache/src/core.rs
@@ -17,7 +17,7 @@
use std::fmt::Debug;
-use crate::*;
+use opendal_core::*;
#[derive(Clone)]
pub struct CacacheCore {
diff --git a/core/core/src/services/cacache/deleter.rs
b/core/services/cacache/src/deleter.rs
similarity index 96%
rename from core/core/src/services/cacache/deleter.rs
rename to core/services/cacache/src/deleter.rs
index 225fbf207..f3972d962 100644
--- a/core/core/src/services/cacache/deleter.rs
+++ b/core/services/cacache/src/deleter.rs
@@ -17,8 +17,8 @@
use std::sync::Arc;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
use super::core::CacacheCore;
diff --git a/core/core/src/services/cacache/docs.md
b/core/services/cacache/src/docs.md
similarity index 93%
rename from core/core/src/services/cacache/docs.md
rename to core/services/cacache/src/docs.md
index 330e79303..f4664dc51 100644
--- a/core/core/src/services/cacache/docs.md
+++ b/core/services/cacache/src/docs.md
@@ -24,7 +24,7 @@ You can refer to [`CacacheBuilder`]'s docs for more
information
```rust,no_run
use anyhow::Result;
-use opendal_core::services::Cacache;
+use opendal_service_cacache::Cacache;
use opendal_core::Operator;
#[tokio::main]
diff --git a/core/core/src/services/cacache/mod.rs
b/core/services/cacache/src/lib.rs
similarity index 84%
rename from core/core/src/services/cacache/mod.rs
rename to core/services/cacache/src/lib.rs
index 236836a2b..92c48600f 100644
--- a/core/core/src/services/cacache/mod.rs
+++ b/core/services/cacache/src/lib.rs
@@ -15,10 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for cacache service.
-pub const CACACHE_SCHEME: &str = "cacache";
+//! Cacache service implementation for Apache OpenDAL.
-use crate::types::DEFAULT_OPERATOR_REGISTRY;
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![deny(missing_docs)]
mod backend;
mod config;
@@ -29,7 +29,10 @@ mod writer;
pub use backend::CacacheBuilder as Cacache;
pub use config::CacacheConfig;
+/// Default scheme for cacache service.
+pub const CACACHE_SCHEME: &str = "cacache";
+
#[ctor::ctor]
fn register_cacache_service() {
- DEFAULT_OPERATOR_REGISTRY.register::<Cacache>(CACACHE_SCHEME);
+
opendal_core::DEFAULT_OPERATOR_REGISTRY.register::<Cacache>(CACACHE_SCHEME);
}
diff --git a/core/core/src/services/cacache/writer.rs
b/core/services/cacache/src/writer.rs
similarity index 97%
rename from core/core/src/services/cacache/writer.rs
rename to core/services/cacache/src/writer.rs
index e82e74aae..7abfe94b0 100644
--- a/core/core/src/services/cacache/writer.rs
+++ b/core/services/cacache/src/writer.rs
@@ -17,8 +17,8 @@
use std::sync::Arc;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
use super::core::CacacheCore;
diff --git a/core/services/dbfs/Cargo.toml b/core/services/dbfs/Cargo.toml
new file mode 100644
index 000000000..b56bb2d5e
--- /dev/null
+++ b/core/services/dbfs/Cargo.toml
@@ -0,0 +1,44 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]
+description = "Apache OpenDAL Dbfs service implementation"
+name = "opendal-service-dbfs"
+
+authors = { workspace = true }
+edition = { workspace = true }
+homepage = { workspace = true }
+license = { workspace = true }
+repository = { workspace = true }
+rust-version = { workspace = true }
+version = { workspace = true }
+
+[package.metadata.docs.rs]
+all-features = true
+
+[dependencies]
+base64 = { workspace = true }
+bytes = { workspace = true }
+ctor = { workspace = true }
+http = { workspace = true }
+log = { workspace = true }
+opendal-core = { path = "../../core", version = "0.55.0", default-features =
false }
+serde = { workspace = true, features = ["derive"] }
+serde_json = { workspace = true }
+
+[dev-dependencies]
+tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
diff --git a/core/core/src/services/dbfs/backend.rs
b/core/services/dbfs/src/backend.rs
similarity index 98%
rename from core/core/src/services/dbfs/backend.rs
rename to core/services/dbfs/src/backend.rs
index d8ce21d0b..fead859dc 100644
--- a/core/core/src/services/dbfs/backend.rs
+++ b/core/services/dbfs/src/backend.rs
@@ -23,14 +23,14 @@ use log::debug;
use serde::Deserialize;
use super::DBFS_SCHEME;
+use super::config::DbfsConfig;
use super::core::DbfsCore;
use super::deleter::DbfsDeleter;
use super::error::parse_error;
use super::lister::DbfsLister;
use super::writer::DbfsWriter;
-use crate::raw::*;
-use crate::services::DbfsConfig;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
/// [Dbfs](https://docs.databricks.com/api/azure/workspace/dbfs)'s REST API
support.
#[doc = include_str!("docs.md")]
diff --git a/core/core/src/services/dbfs/config.rs
b/core/services/dbfs/src/config.rs
similarity index 92%
rename from core/core/src/services/dbfs/config.rs
rename to core/services/dbfs/src/config.rs
index 236282524..3a627470f 100644
--- a/core/core/src/services/dbfs/config.rs
+++ b/core/services/dbfs/src/config.rs
@@ -42,10 +42,10 @@ impl Debug for DbfsConfig {
}
}
-impl crate::Configurator for DbfsConfig {
+impl opendal_core::Configurator for DbfsConfig {
type Builder = DbfsBuilder;
- fn from_uri(uri: &crate::types::OperatorUri) -> crate::Result<Self> {
+ fn from_uri(uri: &opendal_core::OperatorUri) -> opendal_core::Result<Self>
{
let mut map = uri.options().clone();
if let Some(authority) = uri.authority() {
map.insert("endpoint".to_string(), format!("https://{authority}"));
@@ -68,8 +68,8 @@ impl crate::Configurator for DbfsConfig {
#[cfg(test)]
mod tests {
use super::*;
- use crate::Configurator;
- use crate::types::OperatorUri;
+ use opendal_core::Configurator;
+ use opendal_core::OperatorUri;
#[test]
fn from_uri_sets_endpoint_and_root() {
diff --git a/core/core/src/services/dbfs/core.rs
b/core/services/dbfs/src/core.rs
similarity index 99%
rename from core/core/src/services/dbfs/core.rs
rename to core/services/dbfs/src/core.rs
index 19e2b546b..cea2c7c9a 100644
--- a/core/core/src/services/dbfs/core.rs
+++ b/core/services/dbfs/src/core.rs
@@ -27,8 +27,8 @@ use http::header;
use serde_json::json;
use super::error::parse_error;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
pub struct DbfsCore {
pub root: String,
diff --git a/core/core/src/services/dbfs/deleter.rs
b/core/services/dbfs/src/deleter.rs
similarity index 96%
rename from core/core/src/services/dbfs/deleter.rs
rename to core/services/dbfs/src/deleter.rs
index 2d41a1e9b..5433896d7 100644
--- a/core/core/src/services/dbfs/deleter.rs
+++ b/core/services/dbfs/src/deleter.rs
@@ -21,8 +21,8 @@ use http::StatusCode;
use super::core::*;
use super::error::parse_error;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
pub struct DbfsDeleter {
core: Arc<DbfsCore>,
diff --git a/core/core/src/services/dbfs/docs.md
b/core/services/dbfs/src/docs.md
similarity index 100%
rename from core/core/src/services/dbfs/docs.md
rename to core/services/dbfs/src/docs.md
diff --git a/core/core/src/services/dbfs/error.rs
b/core/services/dbfs/src/error.rs
similarity index 98%
rename from core/core/src/services/dbfs/error.rs
rename to core/services/dbfs/src/error.rs
index 50d8fcce0..3c68f0bae 100644
--- a/core/core/src/services/dbfs/error.rs
+++ b/core/services/dbfs/src/error.rs
@@ -21,8 +21,8 @@ use http::Response;
use http::StatusCode;
use serde::Deserialize;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
/// DbfsError is the error returned by DBFS service.
#[derive(Default, Deserialize)]
diff --git a/core/core/src/services/dbfs/mod.rs b/core/services/dbfs/src/lib.rs
similarity index 84%
rename from core/core/src/services/dbfs/mod.rs
rename to core/services/dbfs/src/lib.rs
index 0b7c23d77..a0dc4ae99 100644
--- a/core/core/src/services/dbfs/mod.rs
+++ b/core/services/dbfs/src/lib.rs
@@ -15,10 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for dbfs service.
-pub const DBFS_SCHEME: &str = "dbfs";
+//! Dbfs service implementation for Apache OpenDAL.
-use crate::types::DEFAULT_OPERATOR_REGISTRY;
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![deny(missing_docs)]
mod backend;
mod config;
@@ -31,7 +31,10 @@ mod writer;
pub use backend::DbfsBuilder as Dbfs;
pub use config::DbfsConfig;
+/// Default scheme for dbfs service.
+pub const DBFS_SCHEME: &str = "dbfs";
+
#[ctor::ctor]
fn register_dbfs_service() {
- DEFAULT_OPERATOR_REGISTRY.register::<Dbfs>(DBFS_SCHEME);
+ opendal_core::DEFAULT_OPERATOR_REGISTRY.register::<Dbfs>(DBFS_SCHEME);
}
diff --git a/core/core/src/services/dbfs/lister.rs
b/core/services/dbfs/src/lister.rs
similarity index 98%
rename from core/core/src/services/dbfs/lister.rs
rename to core/services/dbfs/src/lister.rs
index 18e3f3cb3..f713730c6 100644
--- a/core/core/src/services/dbfs/lister.rs
+++ b/core/services/dbfs/src/lister.rs
@@ -23,8 +23,8 @@ use serde::Deserialize;
use super::core::DbfsCore;
use super::error::parse_error;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
pub struct DbfsLister {
core: Arc<DbfsCore>,
diff --git a/core/core/src/services/dbfs/writer.rs
b/core/services/dbfs/src/writer.rs
similarity index 97%
rename from core/core/src/services/dbfs/writer.rs
rename to core/services/dbfs/src/writer.rs
index 48aa9ae22..eb4bb4a73 100644
--- a/core/core/src/services/dbfs/writer.rs
+++ b/core/services/dbfs/src/writer.rs
@@ -21,8 +21,8 @@ use http::StatusCode;
use super::core::DbfsCore;
use super::error::parse_error;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
pub struct DbfsWriter {
core: Arc<DbfsCore>,
diff --git a/core/services/dropbox/Cargo.toml b/core/services/dropbox/Cargo.toml
new file mode 100644
index 000000000..d4e829520
--- /dev/null
+++ b/core/services/dropbox/Cargo.toml
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]
+description = "Apache OpenDAL Dropbox service implementation"
+name = "opendal-service-dropbox"
+
+authors = { workspace = true }
+edition = { workspace = true }
+homepage = { workspace = true }
+license = { workspace = true }
+repository = { workspace = true }
+rust-version = { workspace = true }
+version = { workspace = true }
+
+[package.metadata.docs.rs]
+all-features = true
+
+[dependencies]
+bytes = { workspace = true }
+ctor = { workspace = true }
+http = { workspace = true }
+log = { workspace = true }
+mea = "0.5.1"
+opendal-core = { path = "../../core", version = "0.55.0", default-features =
false }
+serde = { workspace = true, features = ["derive"] }
+serde_json = { workspace = true }
+tokio = { workspace = true }
+
+[dev-dependencies]
+tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
diff --git a/core/core/src/services/dropbox/backend.rs
b/core/services/dropbox/src/backend.rs
similarity index 99%
rename from core/core/src/services/dropbox/backend.rs
rename to core/services/dropbox/src/backend.rs
index f826a87d1..fd25f4de5 100644
--- a/core/core/src/services/dropbox/backend.rs
+++ b/core/services/dropbox/src/backend.rs
@@ -26,8 +26,8 @@ use super::deleter::DropboxDeleter;
use super::error::*;
use super::lister::DropboxLister;
use super::writer::DropboxWriter;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
#[derive(Clone, Debug)]
pub struct DropboxBackend {
diff --git a/core/core/src/services/dropbox/builder.rs
b/core/services/dropbox/src/builder.rs
similarity index 99%
rename from core/core/src/services/dropbox/builder.rs
rename to core/services/dropbox/src/builder.rs
index 6c51675c4..2ba34aa84 100644
--- a/core/core/src/services/dropbox/builder.rs
+++ b/core/services/dropbox/src/builder.rs
@@ -25,8 +25,8 @@ use super::backend::DropboxBackend;
use super::config::DropboxConfig;
use super::core::DropboxCore;
use super::core::DropboxSigner;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
/// [Dropbox](https://www.dropbox.com/) backend support.
#[doc = include_str!("docs.md")]
diff --git a/core/core/src/services/dropbox/config.rs
b/core/services/dropbox/src/config.rs
similarity index 92%
rename from core/core/src/services/dropbox/config.rs
rename to core/services/dropbox/src/config.rs
index 61dcca01b..8124cabd0 100644
--- a/core/core/src/services/dropbox/config.rs
+++ b/core/services/dropbox/src/config.rs
@@ -47,10 +47,10 @@ impl Debug for DropboxConfig {
}
}
-impl crate::Configurator for DropboxConfig {
+impl opendal_core::Configurator for DropboxConfig {
type Builder = DropboxBuilder;
- fn from_uri(uri: &crate::types::OperatorUri) -> crate::Result<Self> {
+ fn from_uri(uri: &opendal_core::OperatorUri) -> opendal_core::Result<Self>
{
let mut map = uri.options().clone();
if let Some(root) = uri.root() {
@@ -70,8 +70,8 @@ impl crate::Configurator for DropboxConfig {
#[cfg(test)]
mod tests {
use super::*;
- use crate::Configurator;
- use crate::types::OperatorUri;
+ use opendal_core::Configurator;
+ use opendal_core::OperatorUri;
#[test]
fn from_uri_sets_root() {
diff --git a/core/core/src/services/dropbox/core.rs
b/core/services/dropbox/src/core.rs
similarity index 99%
rename from core/core/src/services/dropbox/core.rs
rename to core/services/dropbox/src/core.rs
index 13545dde0..b716cb923 100644
--- a/core/core/src/services/dropbox/core.rs
+++ b/core/services/dropbox/src/core.rs
@@ -31,8 +31,8 @@ use serde::Deserialize;
use serde::Serialize;
use super::error::parse_error;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
pub struct DropboxCore {
pub info: Arc<AccessorInfo>,
diff --git a/core/core/src/services/dropbox/deleter.rs
b/core/services/dropbox/src/deleter.rs
similarity index 97%
rename from core/core/src/services/dropbox/deleter.rs
rename to core/services/dropbox/src/deleter.rs
index ca1d9e9ad..ec5eb4ab6 100644
--- a/core/core/src/services/dropbox/deleter.rs
+++ b/core/services/dropbox/src/deleter.rs
@@ -21,8 +21,8 @@ use http::StatusCode;
use super::core::*;
use super::error::parse_error;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
pub struct DropboxDeleter {
core: Arc<DropboxCore>,
diff --git a/core/core/src/services/dropbox/docs.md
b/core/services/dropbox/src/docs.md
similarity index 100%
rename from core/core/src/services/dropbox/docs.md
rename to core/services/dropbox/src/docs.md
diff --git a/core/core/src/services/dropbox/error.rs
b/core/services/dropbox/src/error.rs
similarity index 98%
rename from core/core/src/services/dropbox/error.rs
rename to core/services/dropbox/src/error.rs
index 715d029ed..53fd7390d 100644
--- a/core/core/src/services/dropbox/error.rs
+++ b/core/services/dropbox/src/error.rs
@@ -19,8 +19,8 @@ use http::Response;
use http::StatusCode;
use serde::Deserialize;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
#[derive(Default, Debug, Deserialize)]
#[serde(default)]
diff --git a/core/core/src/services/dropbox/mod.rs
b/core/services/dropbox/src/lib.rs
similarity index 84%
rename from core/core/src/services/dropbox/mod.rs
rename to core/services/dropbox/src/lib.rs
index 3195bf5e5..65d32f249 100644
--- a/core/core/src/services/dropbox/mod.rs
+++ b/core/services/dropbox/src/lib.rs
@@ -15,10 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for dropbox service.
-pub const DROPBOX_SCHEME: &str = "dropbox";
+//! Dropbox service implementation for Apache OpenDAL.
-use crate::types::DEFAULT_OPERATOR_REGISTRY;
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![deny(missing_docs)]
mod backend;
mod builder;
@@ -32,7 +32,10 @@ mod writer;
pub use builder::DropboxBuilder as Dropbox;
pub use config::DropboxConfig;
+/// Default scheme for dropbox service.
+pub const DROPBOX_SCHEME: &str = "dropbox";
+
#[ctor::ctor]
fn register_dropbox_service() {
- DEFAULT_OPERATOR_REGISTRY.register::<Dropbox>(DROPBOX_SCHEME);
+
opendal_core::DEFAULT_OPERATOR_REGISTRY.register::<Dropbox>(DROPBOX_SCHEME);
}
diff --git a/core/core/src/services/dropbox/lister.rs
b/core/services/dropbox/src/lister.rs
similarity index 98%
rename from core/core/src/services/dropbox/lister.rs
rename to core/services/dropbox/src/lister.rs
index 3dc70c91c..bfdc07a27 100644
--- a/core/core/src/services/dropbox/lister.rs
+++ b/core/services/dropbox/src/lister.rs
@@ -21,8 +21,8 @@ use bytes::Buf;
use super::core::*;
use super::error::parse_error;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
pub struct DropboxLister {
core: Arc<DropboxCore>,
diff --git a/core/core/src/services/dropbox/writer.rs
b/core/services/dropbox/src/writer.rs
similarity index 98%
rename from core/core/src/services/dropbox/writer.rs
rename to core/services/dropbox/src/writer.rs
index eff7c23cb..cf7b898bf 100644
--- a/core/core/src/services/dropbox/writer.rs
+++ b/core/services/dropbox/src/writer.rs
@@ -22,8 +22,8 @@ use http::StatusCode;
use super::core::{DropboxCore, DropboxMetadataResponse};
use super::error::parse_error;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
pub struct DropboxWriter {
core: Arc<DropboxCore>,
diff --git a/core/services/etcd/Cargo.toml b/core/services/etcd/Cargo.toml
new file mode 100644
index 000000000..3bbbfde41
--- /dev/null
+++ b/core/services/etcd/Cargo.toml
@@ -0,0 +1,44 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]
+description = "Apache OpenDAL Etcd service implementation"
+name = "opendal-service-etcd"
+
+authors = { workspace = true }
+edition = { workspace = true }
+homepage = { workspace = true }
+license = { workspace = true }
+repository = { workspace = true }
+rust-version = { workspace = true }
+version = { workspace = true }
+
+[package.metadata.docs.rs]
+all-features = true
+
+[dependencies]
+bytes = { workspace = true }
+ctor = { workspace = true }
+etcd-client = { version = "0.17", features = ["tls"] }
+fastpool = "1.0.2"
+log = { workspace = true }
+opendal-core = { path = "../../core", version = "0.55.0", default-features =
false }
+serde = { workspace = true, features = ["derive"] }
+tokio = { workspace = true }
+
+[dev-dependencies]
+tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
diff --git a/core/core/src/services/etcd/backend.rs
b/core/services/etcd/src/backend.rs
similarity index 99%
rename from core/core/src/services/etcd/backend.rs
rename to core/services/etcd/src/backend.rs
index 317345240..3012021ef 100644
--- a/core/core/src/services/etcd/backend.rs
+++ b/core/services/etcd/src/backend.rs
@@ -29,8 +29,8 @@ use super::core::constants::DEFAULT_ETCD_ENDPOINTS;
use super::deleter::EtcdDeleter;
use super::lister::EtcdLister;
use super::writer::EtcdWriter;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
/// [Etcd](https://etcd.io/) services support.
#[doc = include_str!("docs.md")]
diff --git a/core/core/src/services/etcd/config.rs
b/core/services/etcd/src/config.rs
similarity index 94%
rename from core/core/src/services/etcd/config.rs
rename to core/services/etcd/src/config.rs
index 592ae68d3..cd743b364 100644
--- a/core/core/src/services/etcd/config.rs
+++ b/core/services/etcd/src/config.rs
@@ -72,10 +72,10 @@ impl Debug for EtcdConfig {
}
}
-impl crate::Configurator for EtcdConfig {
+impl opendal_core::Configurator for EtcdConfig {
type Builder = EtcdBuilder;
- fn from_uri(uri: &crate::types::OperatorUri) -> crate::Result<Self> {
+ fn from_uri(uri: &opendal_core::OperatorUri) -> opendal_core::Result<Self>
{
let mut map = uri.options().clone();
if let Some(authority) = uri.authority() {
@@ -100,8 +100,8 @@ impl crate::Configurator for EtcdConfig {
#[cfg(test)]
mod tests {
use super::*;
- use crate::Configurator;
- use crate::types::OperatorUri;
+ use opendal_core::Configurator;
+ use opendal_core::OperatorUri;
#[test]
fn from_uri_sets_endpoints_and_root() {
diff --git a/core/core/src/services/etcd/core.rs
b/core/services/etcd/src/core.rs
similarity index 97%
rename from core/core/src/services/etcd/core.rs
rename to core/services/etcd/src/core.rs
index 2d458f27b..9836f6d9b 100644
--- a/core/core/src/services/etcd/core.rs
+++ b/core/services/etcd/src/core.rs
@@ -23,9 +23,9 @@ use fastpool::bounded;
use std::fmt::Debug;
use std::sync::Arc;
-use crate::raw::*;
-use crate::services::etcd::error::format_etcd_error;
-use crate::{Buffer, Error, ErrorKind, Result};
+use super::error::format_etcd_error;
+use opendal_core::raw::*;
+use opendal_core::{Buffer, Error, ErrorKind, Result};
pub mod constants {
pub const DEFAULT_ETCD_ENDPOINTS: &str = "http://127.0.0.1:2379";
diff --git a/core/core/src/services/etcd/deleter.rs
b/core/services/etcd/src/deleter.rs
similarity index 94%
rename from core/core/src/services/etcd/deleter.rs
rename to core/services/etcd/src/deleter.rs
index 66bbd16df..ac4001c0d 100644
--- a/core/core/src/services/etcd/deleter.rs
+++ b/core/services/etcd/src/deleter.rs
@@ -18,9 +18,9 @@
use std::sync::Arc;
use super::core::EtcdCore;
-use crate::raw::oio;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::oio;
+use opendal_core::raw::*;
+use opendal_core::*;
pub struct EtcdDeleter {
core: Arc<EtcdCore>,
diff --git a/core/core/src/services/etcd/docs.md
b/core/services/etcd/src/docs.md
similarity index 100%
rename from core/core/src/services/etcd/docs.md
rename to core/services/etcd/src/docs.md
diff --git a/core/core/src/services/etcd/error.rs
b/core/services/etcd/src/error.rs
similarity index 96%
rename from core/core/src/services/etcd/error.rs
rename to core/services/etcd/src/error.rs
index 1293d9ecd..d12d32ab5 100644
--- a/core/core/src/services/etcd/error.rs
+++ b/core/services/etcd/src/error.rs
@@ -17,7 +17,7 @@
use etcd_client::Error as EtcdError;
-use crate::{Error, ErrorKind};
+use opendal_core::{Error, ErrorKind};
pub fn format_etcd_error(e: EtcdError) -> Error {
Error::new(ErrorKind::Unexpected, e.to_string().as_str())
diff --git a/core/core/src/services/etcd/mod.rs b/core/services/etcd/src/lib.rs
similarity index 84%
rename from core/core/src/services/etcd/mod.rs
rename to core/services/etcd/src/lib.rs
index a28e5fdca..b3dfafbc3 100644
--- a/core/core/src/services/etcd/mod.rs
+++ b/core/services/etcd/src/lib.rs
@@ -15,10 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for etcd service.
-pub const ETCD_SCHEME: &str = "etcd";
+//! Etcd service implementation for Apache OpenDAL.
-use crate::types::DEFAULT_OPERATOR_REGISTRY;
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![deny(missing_docs)]
mod backend;
mod config;
@@ -31,7 +31,10 @@ mod writer;
pub use backend::EtcdBuilder as Etcd;
pub use config::EtcdConfig;
+/// Default scheme for etcd service.
+pub const ETCD_SCHEME: &str = "etcd";
+
#[ctor::ctor]
fn register_etcd_service() {
- DEFAULT_OPERATOR_REGISTRY.register::<Etcd>(ETCD_SCHEME);
+ opendal_core::DEFAULT_OPERATOR_REGISTRY.register::<Etcd>(ETCD_SCHEME);
}
diff --git a/core/core/src/services/etcd/lister.rs
b/core/services/etcd/src/lister.rs
similarity index 95%
rename from core/core/src/services/etcd/lister.rs
rename to core/services/etcd/src/lister.rs
index 39d143c3e..667a6e2c5 100644
--- a/core/core/src/services/etcd/lister.rs
+++ b/core/services/etcd/src/lister.rs
@@ -19,9 +19,9 @@ use std::sync::Arc;
use std::vec::IntoIter;
use super::core::EtcdCore;
-use crate::raw::oio::Entry;
-use crate::raw::{build_abs_path, build_rel_path, oio};
-use crate::*;
+use opendal_core::raw::oio::Entry;
+use opendal_core::raw::{build_abs_path, build_rel_path, oio};
+use opendal_core::*;
pub struct EtcdLister {
root: String,
diff --git a/core/core/src/services/etcd/writer.rs
b/core/services/etcd/src/writer.rs
similarity index 97%
rename from core/core/src/services/etcd/writer.rs
rename to core/services/etcd/src/writer.rs
index 1ed2e88c2..7ab5714bd 100644
--- a/core/core/src/services/etcd/writer.rs
+++ b/core/services/etcd/src/writer.rs
@@ -18,8 +18,8 @@
use std::sync::Arc;
use super::core::EtcdCore;
-use crate::raw::oio;
-use crate::*;
+use opendal_core::raw::oio;
+use opendal_core::*;
pub struct EtcdWriter {
core: Arc<EtcdCore>,
diff --git a/core/services/foundationdb/Cargo.toml
b/core/services/foundationdb/Cargo.toml
new file mode 100644
index 000000000..9b0ee360e
--- /dev/null
+++ b/core/services/foundationdb/Cargo.toml
@@ -0,0 +1,46 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]
+description = "Apache OpenDAL Foundationdb service implementation"
+name = "opendal-service-foundationdb"
+
+authors = { workspace = true }
+edition = { workspace = true }
+homepage = { workspace = true }
+license = { workspace = true }
+repository = { workspace = true }
+rust-version = { workspace = true }
+version = { workspace = true }
+
+[package.metadata.docs.rs]
+all-features = true
+
+[dependencies]
+bytes = { workspace = true }
+ctor = { workspace = true }
+foundationdb = { version = "0.9.0", features = [
+ "embedded-fdb-include",
+ "fdb-7_3",
+] }
+log = { workspace = true }
+opendal-core = { path = "../../core", version = "0.55.0", default-features =
false }
+serde = { workspace = true, features = ["derive"] }
+tokio = { workspace = true }
+
+[dev-dependencies]
+tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
diff --git a/core/core/src/services/foundationdb/backend.rs
b/core/services/foundationdb/src/backend.rs
similarity index 99%
rename from core/core/src/services/foundationdb/backend.rs
rename to core/services/foundationdb/src/backend.rs
index ca22a51ae..0e7a46049 100644
--- a/core/core/src/services/foundationdb/backend.rs
+++ b/core/services/foundationdb/src/backend.rs
@@ -25,8 +25,8 @@ use super::config::FoundationdbConfig;
use super::core::*;
use super::deleter::FoundationdbDeleter;
use super::writer::FoundationdbWriter;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
#[doc = include_str!("docs.md")]
#[derive(Debug, Default)]
diff --git a/core/core/src/services/foundationdb/config.rs
b/core/services/foundationdb/src/config.rs
similarity index 91%
rename from core/core/src/services/foundationdb/config.rs
rename to core/services/foundationdb/src/config.rs
index 86cbbc407..c851d9e00 100644
--- a/core/core/src/services/foundationdb/config.rs
+++ b/core/services/foundationdb/src/config.rs
@@ -32,10 +32,10 @@ pub struct FoundationdbConfig {
pub config_path: Option<String>,
}
-impl crate::Configurator for FoundationdbConfig {
+impl opendal_core::Configurator for FoundationdbConfig {
type Builder = FoundationdbBuilder;
- fn from_uri(uri: &crate::types::OperatorUri) -> crate::Result<Self> {
+ fn from_uri(uri: &opendal_core::OperatorUri) -> opendal_core::Result<Self>
{
let mut map = uri.options().clone();
if let Some(path) = uri.root() {
@@ -56,8 +56,8 @@ impl crate::Configurator for FoundationdbConfig {
#[cfg(test)]
mod tests {
use super::*;
- use crate::Configurator;
- use crate::types::OperatorUri;
+ use opendal_core::Configurator;
+ use opendal_core::OperatorUri;
#[test]
fn from_uri_sets_config_path_and_root() {
diff --git a/core/core/src/services/foundationdb/core.rs
b/core/services/foundationdb/src/core.rs
similarity index 99%
rename from core/core/src/services/foundationdb/core.rs
rename to core/services/foundationdb/src/core.rs
index e1fd5032f..86ac15953 100644
--- a/core/core/src/services/foundationdb/core.rs
+++ b/core/services/foundationdb/src/core.rs
@@ -22,7 +22,7 @@ use foundationdb::Database;
use foundationdb::api::NetworkAutoStop;
use super::FOUNDATIONDB_SCHEME;
-use crate::*;
+use opendal_core::*;
#[derive(Clone)]
pub struct FoundationdbCore {
diff --git a/core/core/src/services/foundationdb/deleter.rs
b/core/services/foundationdb/src/deleter.rs
similarity index 94%
rename from core/core/src/services/foundationdb/deleter.rs
rename to core/services/foundationdb/src/deleter.rs
index 46f4f9d48..747e139ce 100644
--- a/core/core/src/services/foundationdb/deleter.rs
+++ b/core/services/foundationdb/src/deleter.rs
@@ -18,9 +18,9 @@
use std::sync::Arc;
use super::core::*;
-use crate::raw::oio;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::oio;
+use opendal_core::raw::*;
+use opendal_core::*;
pub struct FoundationdbDeleter {
core: Arc<FoundationdbCore>,
diff --git a/core/core/src/services/foundationdb/docs.md
b/core/services/foundationdb/src/docs.md
similarity index 100%
rename from core/core/src/services/foundationdb/docs.md
rename to core/services/foundationdb/src/docs.md
diff --git a/core/core/src/services/foundationdb/mod.rs
b/core/services/foundationdb/src/lib.rs
similarity index 83%
rename from core/core/src/services/foundationdb/mod.rs
rename to core/services/foundationdb/src/lib.rs
index cf67f3f0b..d544919e9 100644
--- a/core/core/src/services/foundationdb/mod.rs
+++ b/core/services/foundationdb/src/lib.rs
@@ -15,10 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-/// Default scheme for foundationdb service.
-pub const FOUNDATIONDB_SCHEME: &str = "foundationdb";
+//! Foundationdb service implementation for Apache OpenDAL.
-use crate::types::DEFAULT_OPERATOR_REGISTRY;
+#![cfg_attr(docsrs, feature(doc_cfg))]
+#![deny(missing_docs)]
mod backend;
mod config;
@@ -29,7 +29,10 @@ mod writer;
pub use backend::FoundationdbBuilder as Foundationdb;
pub use config::FoundationdbConfig;
+/// Default scheme for foundationdb service.
+pub const FOUNDATIONDB_SCHEME: &str = "foundationdb";
+
#[ctor::ctor]
fn register_foundationdb_service() {
- DEFAULT_OPERATOR_REGISTRY.register::<Foundationdb>(FOUNDATIONDB_SCHEME);
+
opendal_core::DEFAULT_OPERATOR_REGISTRY.register::<Foundationdb>(FOUNDATIONDB_SCHEME);
}
diff --git a/core/core/src/services/foundationdb/writer.rs
b/core/services/foundationdb/src/writer.rs
similarity index 97%
rename from core/core/src/services/foundationdb/writer.rs
rename to core/services/foundationdb/src/writer.rs
index 7a8c2be36..81ca5ee99 100644
--- a/core/core/src/services/foundationdb/writer.rs
+++ b/core/services/foundationdb/src/writer.rs
@@ -18,8 +18,8 @@
use std::sync::Arc;
use super::core::*;
-use crate::raw::oio;
-use crate::*;
+use opendal_core::raw::oio;
+use opendal_core::*;
pub struct FoundationdbWriter {
core: Arc<FoundationdbCore>,
diff --git a/core/src/lib.rs b/core/src/lib.rs
index e978f42f2..870c4887b 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -42,6 +42,8 @@ pub mod services {
pub use opendal_service_azfile::*;
#[cfg(feature = "services-b2")]
pub use opendal_service_b2::*;
+ #[cfg(feature = "services-cacache")]
+ pub use opendal_service_cacache::*;
#[cfg(feature = "services-cloudflare-kv")]
pub use opendal_service_cloudflare_kv::*;
#[cfg(feature = "services-compfs")]
@@ -52,6 +54,14 @@ pub mod services {
pub use opendal_service_d1::*;
#[cfg(feature = "services-dashmap")]
pub use opendal_service_dashmap::*;
+ #[cfg(feature = "services-dbfs")]
+ pub use opendal_service_dbfs::*;
+ #[cfg(feature = "services-dropbox")]
+ pub use opendal_service_dropbox::*;
+ #[cfg(feature = "services-etcd")]
+ pub use opendal_service_etcd::*;
+ #[cfg(feature = "services-foundationdb")]
+ pub use opendal_service_foundationdb::*;
#[cfg(feature = "services-fs")]
pub use opendal_service_fs::*;
#[cfg(feature = "services-ftp")]