You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2026/07/29 16:51:52 UTC
(opendal-ofs) branch xuanwo/remove-cloud-filter created (now 62ab22a)
This is an automated email from the ASF dual-hosted git repository.
Xuanwo pushed a change to branch xuanwo/remove-cloud-filter
in repository https://gitbox.apache.org/repos/asf/opendal-ofs.git
at 62ab22a chore: remove unsupported Cloud Filter integration
This branch includes the following new commits:
new 62ab22a chore: remove unsupported Cloud Filter integration
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(opendal-ofs) 01/01: chore: remove unsupported Cloud Filter integration
Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
Xuanwo pushed a commit to branch xuanwo/remove-cloud-filter
in repository https://gitbox.apache.org/repos/asf/opendal-ofs.git
commit 62ab22aa2822a87df9e0001c411a5f59a937d0fa
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Thu Jul 30 00:50:59 2026 +0800
chore: remove unsupported Cloud Filter integration
---
Cargo.lock | 184 ------------
Cargo.toml | 4 -
DEPENDENCIES.rust.tsv | 37 +--
integrations/cloud_filter/.gitignore | 1 -
integrations/cloud_filter/Cargo.toml | 58 ----
integrations/cloud_filter/DEPENDENCIES.rust.tsv | 199 -------------
integrations/cloud_filter/README.md | 90 ------
integrations/cloud_filter/examples/readonly.rs | 74 -----
integrations/cloud_filter/src/file.rs | 24 --
integrations/cloud_filter/src/lib.rs | 317 ---------------------
integrations/cloud_filter/tests/behavior/README.md | 12 -
.../cloud_filter/tests/behavior/fetch_data.rs | 51 ----
.../tests/behavior/fetch_placeholder.rs | 38 ---
integrations/cloud_filter/tests/behavior/main.rs | 118 --------
integrations/cloud_filter/tests/behavior/utils.rs | 51 ----
src/main.rs | 71 -----
16 files changed, 12 insertions(+), 1317 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 54ee6d4..307f6e3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -191,15 +191,6 @@ dependencies = [
"rand_core",
]
-[[package]]
-name = "chrono"
-version = "0.4.42"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2"
-dependencies = [
- "num-traits",
-]
-
[[package]]
name = "clap"
version = "4.5.48"
@@ -240,32 +231,6 @@ version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675"
-[[package]]
-name = "cloud-filter"
-version = "0.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e14c1f7a726923ec7bb56faa4ef71b8e7be56b98f2bb8e406d35cb7e5efe7894"
-dependencies = [
- "flagset",
- "memoffset",
- "nt-time",
- "widestring",
- "windows",
-]
-
-[[package]]
-name = "cloud_filter_opendal"
-version = "0.0.12"
-dependencies = [
- "anyhow",
- "bincode",
- "cloud-filter",
- "futures",
- "log",
- "opendal",
- "serde",
-]
-
[[package]]
name = "cmake"
version = "0.1.58"
@@ -415,15 +380,6 @@ dependencies = [
"cmov",
]
-[[package]]
-name = "deranged"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a41953f86f8a05768a6cda24def994fd2f424b04ec5c719cf89989779f199071"
-dependencies = [
- "powerfmt",
-]
-
[[package]]
name = "digest"
version = "0.11.3"
@@ -446,7 +402,6 @@ dependencies = [
"quote",
"syn",
]
-
[[package]]
name = "dlv-list"
version = "0.5.2"
@@ -524,12 +479,6 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
-[[package]]
-name = "flagset"
-version = "0.4.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7ac824320a75a52197e8f2d787f6a38b6718bb6897a35142d749af3c0e8f4fe"
-
[[package]]
name = "fnv"
version = "1.0.7"
@@ -1353,39 +1302,12 @@ dependencies = [
"libc",
]
-[[package]]
-name = "nt-time"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2de419e64947cd8830e66beb584acc3fb42ed411d103e3c794dda355d1b374b5"
-dependencies = [
- "chrono",
- "time",
-]
-
-[[package]]
-name = "num-conv"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"
-
-[[package]]
-name = "num-traits"
-version = "0.2.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
-dependencies = [
- "autocfg",
-]
-
[[package]]
name = "ofs"
version = "0.0.24"
dependencies = [
"anyhow",
"clap",
- "cloud-filter",
- "cloud_filter_opendal",
"fuse3",
"fuse3_opendal",
"libc",
@@ -1617,12 +1539,6 @@ dependencies = [
"zerovec",
]
-[[package]]
-name = "powerfmt"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
-
[[package]]
name = "prettyplease"
version = "0.2.37"
@@ -2395,36 +2311,6 @@ dependencies = [
"syn",
]
-[[package]]
-name = "time"
-version = "0.3.47"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c"
-dependencies = [
- "deranged",
- "num-conv",
- "powerfmt",
- "serde_core",
- "time-core",
- "time-macros",
-]
-
-[[package]]
-name = "time-core"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca"
-
-[[package]]
-name = "time-macros"
-version = "0.2.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215"
-dependencies = [
- "num-conv",
- "time-core",
-]
-
[[package]]
name = "tiny-keccak"
version = "2.0.2"
@@ -2900,12 +2786,6 @@ dependencies = [
"winsafe",
]
-[[package]]
-name = "widestring"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d"
-
[[package]]
name = "winapi-util"
version = "0.1.11"
@@ -2915,76 +2795,12 @@ dependencies = [
"windows-sys 0.52.0",
]
-[[package]]
-name = "windows"
-version = "0.58.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6"
-dependencies = [
- "windows-core",
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows-core"
-version = "0.58.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99"
-dependencies = [
- "windows-implement",
- "windows-interface",
- "windows-result",
- "windows-strings",
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows-implement"
-version = "0.58.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "windows-interface"
-version = "0.58.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
[[package]]
name = "windows-link"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
-[[package]]
-name = "windows-result"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e"
-dependencies = [
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows-strings"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10"
-dependencies = [
- "windows-result",
- "windows-targets 0.52.6",
-]
-
[[package]]
name = "windows-sys"
version = "0.52.0"
diff --git a/Cargo.toml b/Cargo.toml
index 7f01059..f746582 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -50,10 +50,6 @@ fuse3_opendal = { version = "0.0.19", path = "integrations/fuse3" }
libc = "0.2.154"
nix = { version = "0.30.1", features = ["user"] }
-[target.'cfg(target_os = "windows")'.dependencies]
-cloud-filter = { version = "0.0.6" }
-cloud_filter_opendal = { version = "0.0.12", path = "integrations/cloud_filter" }
-
[features]
default = ["services-fs", "services-s3"]
services-fs = ["opendal/services-fs"]
diff --git a/DEPENDENCIES.rust.tsv b/DEPENDENCIES.rust.tsv
index b0aa870..518e264 100644
--- a/DEPENDENCIES.rust.tsv
+++ b/DEPENDENCIES.rust.tsv
@@ -24,13 +24,10 @@ bytes@1.10.1 X
cc@1.2.23 X X
cfg-if@1.0.0 X X
cfg_aliases@0.2.1 X
-chrono@0.4.41 X X
clap@4.5.40 X X
clap_builder@4.5.40 X X
clap_derive@4.5.40 X X
clap_lex@0.7.4 X X
-cloud-filter@0.0.6 X
-cloud_filter_opendal@0.0.12 X
colorchoice@1.0.3 X X
concurrent-queue@2.5.0 X X
const-oid@0.9.6 X X
@@ -39,7 +36,6 @@ cpufeatures@0.2.17 X X
crc32c@0.6.8 X X
crossbeam-utils@0.8.21 X X
crypto-common@0.1.6 X X
-deranged@0.4.0 X X
digest@0.10.7 X X
displaydoc@0.2.5 X X
dotenvy@0.15.7 X
@@ -48,7 +44,6 @@ env_filter@0.1.3 X X
errno@0.3.12 X X
event-listener@4.0.3 X X
fastrand@2.3.0 X X
-flagset@0.4.7 X
fnv@1.0.7 X X
form_urlencoded@1.2.1 X X
fuse3@0.8.1 X
@@ -111,9 +106,6 @@ miniz_oxide@0.8.8 X X X
mio@1.0.3 X
nix@0.29.0 X
nix@0.30.1 X
-nt-time@0.8.1 X X
-num-conv@0.1.0 X X
-num-traits@0.2.19 X X
object@0.36.7 X X
ofs@0.0.24 X
once_cell@1.21.3 X X
@@ -125,7 +117,6 @@ pin-utils@0.1.0 X X
portable-atomic@1.11.0 X X
portable-atomic-util@0.2.4 X X
potential_utf@0.1.2 X
-powerfmt@0.2.0 X X
ppv-lite86@0.2.21 X X
proc-macro2@1.0.95 X X
quick-xml@0.37.5 X
@@ -169,9 +160,6 @@ subtle@2.6.1 X
syn@2.0.101 X X
sync_wrapper@1.0.2 X
synstructure@0.13.2 X
-time@0.3.41 X X
-time-core@0.1.4 X X
-time-macros@0.2.22 X X
tinystr@0.8.1 X
tokio@1.47.0 X
tokio-macros@2.5.0 X
@@ -208,30 +196,29 @@ web-sys@0.3.77 X X
webpki-roots@0.26.11 X
webpki-roots@1.0.0 X
which@6.0.3 X
-widestring@1.2.0 X X
-windows@0.58.0 X X
-windows-core@0.58.0 X X
-windows-core@0.61.2 X X
-windows-implement@0.58.0 X X
-windows-implement@0.60.0 X X
-windows-interface@0.58.0 X X
-windows-interface@0.59.1 X X
-windows-link@0.1.1 X X
-windows-result@0.2.0 X X
-windows-result@0.3.4 X X
-windows-strings@0.1.0 X X
-windows-strings@0.4.2 X X
+windows-link@0.2.1 X X
windows-sys@0.52.0 X X
windows-sys@0.59.0 X X
+windows-sys@0.60.2 X X
+windows-sys@0.61.2 X X
windows-targets@0.52.6 X X
+windows-targets@0.53.5 X X
windows_aarch64_gnullvm@0.52.6 X X
+windows_aarch64_gnullvm@0.53.1 X X
windows_aarch64_msvc@0.52.6 X X
+windows_aarch64_msvc@0.53.1 X X
windows_i686_gnu@0.52.6 X X
+windows_i686_gnu@0.53.1 X X
windows_i686_gnullvm@0.52.6 X X
+windows_i686_gnullvm@0.53.1 X X
windows_i686_msvc@0.52.6 X X
+windows_i686_msvc@0.53.1 X X
windows_x86_64_gnu@0.52.6 X X
+windows_x86_64_gnu@0.53.1 X X
windows_x86_64_gnullvm@0.52.6 X X
+windows_x86_64_gnullvm@0.53.1 X X
windows_x86_64_msvc@0.52.6 X X
+windows_x86_64_msvc@0.53.1 X X
winsafe@0.0.19 X
wit-bindgen-rt@0.39.0 X X X
writeable@0.6.1 X
diff --git a/integrations/cloud_filter/.gitignore b/integrations/cloud_filter/.gitignore
deleted file mode 100644
index 03314f7..0000000
--- a/integrations/cloud_filter/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-Cargo.lock
diff --git a/integrations/cloud_filter/Cargo.toml b/integrations/cloud_filter/Cargo.toml
deleted file mode 100644
index 6d26905..0000000
--- a/integrations/cloud_filter/Cargo.toml
+++ /dev/null
@@ -1,58 +0,0 @@
-# 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]
-authors = ["Apache OpenDAL <de...@opendal.apache.org>"]
-description = "Cloud Filter Integration for Apache OpenDAL"
-edition = "2024"
-homepage = "https://opendal.apache.org/"
-license = "Apache-2.0"
-name = "cloud_filter_opendal"
-repository = "https://github.com/apache/opendal"
-rust-version = "1.88"
-version = "0.0.12"
-
-[package.metadata.docs.rs]
-default-target = "x86_64-pc-windows-msvc"
-
-[dependencies]
-anyhow = "1.0.86"
-bincode = "1.3.3"
-cloud-filter = "0.0.6"
-futures = "0.3.30"
-log = "0.4.17"
-opendal = { version = "0.57.0" }
-serde = { version = "1.0.203", features = ["derive"] }
-
-[dev-dependencies]
-libtest-mimic = { version = "0.8.1" }
-logforth = { version = "0.23.1", default-features = false }
-opendal = { version = "0.57.0", features = [
- "services-fs",
- "tests",
-] }
-powershell_script = "1.1.0"
-tokio = { version = "1.38.0", features = [
- "macros",
- "rt-multi-thread",
- "signal",
-] }
-
-[[test]]
-harness = false
-name = "behavior"
-path = "tests/behavior/main.rs"
diff --git a/integrations/cloud_filter/DEPENDENCIES.rust.tsv b/integrations/cloud_filter/DEPENDENCIES.rust.tsv
deleted file mode 100644
index a369c09..0000000
--- a/integrations/cloud_filter/DEPENDENCIES.rust.tsv
+++ /dev/null
@@ -1,199 +0,0 @@
-crate 0BSD Apache-2.0 Apache-2.0 WITH LLVM-exception BSD-2-Clause BSD-3-Clause BSL-1.0 CDLA-Permissive-2.0 ISC LGPL-2.1-or-later MIT Unicode-3.0 Unlicense Zlib
-addr2line@0.24.2 X X
-adler2@2.0.1 X X X
-android-tzdata@0.1.1 X X
-android_system_properties@0.1.5 X X
-anyhow@1.0.98 X X
-async-trait@0.1.88 X X
-autocfg@1.5.0 X X
-backon@1.5.1 X
-backtrace@0.3.75 X X
-base64@0.22.1 X X
-bincode@1.3.3 X
-bitflags@2.9.1 X X
-block-buffer@0.10.4 X X
-bumpalo@3.19.0 X X
-bytes@1.10.1 X
-cc@1.2.29 X X
-cfg-if@1.0.1 X X
-chrono@0.4.41 X X
-cloud-filter@0.0.6 X
-cloud_filter_opendal@0.0.12 X
-const-oid@0.9.6 X X
-core-foundation-sys@0.8.7 X X
-cpufeatures@0.2.17 X X
-crc32c@0.6.8 X X
-crypto-common@0.1.6 X X
-deranged@0.4.0 X X
-digest@0.10.7 X X
-displaydoc@0.2.5 X X
-dotenvy@0.15.7 X
-fastrand@2.3.0 X X
-flagset@0.4.7 X
-fnv@1.0.7 X X
-form_urlencoded@1.2.1 X X
-futures@0.3.31 X X
-futures-channel@0.3.31 X X
-futures-core@0.3.31 X X
-futures-executor@0.3.31 X X
-futures-io@0.3.31 X X
-futures-macro@0.3.31 X X
-futures-sink@0.3.31 X X
-futures-task@0.3.31 X X
-futures-util@0.3.31 X X
-generic-array@0.14.7 X
-getrandom@0.2.16 X X
-getrandom@0.3.3 X X
-gimli@0.31.1 X X
-gloo-timers@0.3.0 X X
-hex@0.4.3 X X
-hmac@0.12.1 X X
-home@0.5.11 X X
-http@1.3.1 X X
-http-body@1.0.1 X
-http-body-util@0.1.3 X
-httparse@1.10.1 X X
-hyper@1.6.0 X
-hyper-rustls@0.27.7 X X X
-hyper-util@0.1.15 X
-iana-time-zone@0.1.63 X X
-iana-time-zone-haiku@0.1.2 X X
-icu_collections@2.0.0 X
-icu_locale_core@2.0.0 X
-icu_normalizer@2.0.0 X
-icu_normalizer_data@2.0.0 X
-icu_properties@2.0.1 X
-icu_properties_data@2.0.1 X
-icu_provider@2.0.0 X
-idna@1.0.3 X X
-idna_adapter@1.2.1 X X
-io-uring@0.7.8 X X
-ipnet@2.11.0 X X
-iri-string@0.7.8 X X
-itoa@1.0.15 X X
-js-sys@0.3.77 X X
-libc@0.2.174 X X
-litemap@0.8.0 X
-log@0.4.27 X X
-md-5@0.10.6 X X
-memchr@2.7.5 X X
-memoffset@0.9.1 X
-miniz_oxide@0.8.9 X X X
-mio@1.0.4 X
-nt-time@0.8.1 X X
-num-conv@0.1.0 X X
-num-traits@0.2.19 X X
-object@0.36.7 X X
-once_cell@1.21.3 X X
-opendal@0.54.1 X
-percent-encoding@2.3.1 X X
-pin-project-lite@0.2.16 X X
-pin-utils@0.1.0 X X
-potential_utf@0.1.2 X
-powerfmt@0.2.0 X X
-ppv-lite86@0.2.21 X X
-proc-macro2@1.0.95 X X
-quick-xml@0.37.5 X
-quick-xml@0.38.0 X
-quote@1.0.40 X X
-r-efi@5.3.0 X X X
-rand@0.8.5 X X
-rand_chacha@0.3.1 X X
-rand_core@0.6.4 X X
-reqsign@0.16.5 X
-reqwest@0.12.22 X X
-ring@0.17.14 X X
-rustc-demangle@0.1.25 X X
-rustc_version@0.4.1 X X
-rustls@0.23.29 X X X
-rustls-pki-types@1.12.0 X X
-rustls-webpki@0.103.4 X
-rustversion@1.0.21 X X
-ryu@1.0.20 X X
-semver@1.0.26 X X
-serde@1.0.219 X X
-serde_derive@1.0.219 X X
-serde_json@1.0.140 X X
-serde_urlencoded@0.7.1 X X
-sha1@0.10.6 X X
-sha2@0.10.9 X X
-shlex@1.3.0 X X
-signal-hook-registry@1.4.5 X X
-slab@0.4.10 X
-smallvec@1.15.1 X X
-socket2@0.5.10 X X
-socket2@0.6.0 X X
-stable_deref_trait@1.2.0 X X
-subtle@2.6.1 X
-syn@2.0.104 X X
-sync_wrapper@1.0.2 X
-synstructure@0.13.2 X
-time@0.3.41 X X
-time-core@0.1.4 X X
-time-macros@0.2.22 X X
-tinystr@0.8.1 X
-tokio@1.47.1 X
-tokio-macros@2.5.0 X
-tokio-rustls@0.26.2 X X
-tokio-util@0.7.15 X
-tower@0.5.2 X
-tower-http@0.6.6 X
-tower-layer@0.3.3 X
-tower-service@0.3.3 X
-tracing@0.1.41 X
-tracing-core@0.1.34 X
-try-lock@0.2.5 X
-typenum@1.18.0 X X
-unicode-ident@1.0.18 X X X
-untrusted@0.9.0 X
-url@2.5.4 X X
-utf8_iter@1.0.4 X X
-uuid@1.17.0 X X
-version_check@0.9.5 X X
-want@0.3.1 X
-wasi@0.11.1+wasi-snapshot-preview1 X X X
-wasi@0.14.2+wasi-0.2.4 X X X
-wasm-bindgen@0.2.100 X X
-wasm-bindgen-backend@0.2.100 X X
-wasm-bindgen-futures@0.4.50 X X
-wasm-bindgen-macro@0.2.100 X X
-wasm-bindgen-macro-support@0.2.100 X X
-wasm-bindgen-shared@0.2.100 X X
-wasm-streams@0.4.2 X X
-web-sys@0.3.77 X X
-webpki-roots@1.0.1 X
-widestring@1.2.0 X X
-windows@0.58.0 X X
-windows-core@0.58.0 X X
-windows-core@0.61.2 X X
-windows-implement@0.58.0 X X
-windows-implement@0.60.0 X X
-windows-interface@0.58.0 X X
-windows-interface@0.59.1 X X
-windows-link@0.1.3 X X
-windows-result@0.2.0 X X
-windows-result@0.3.4 X X
-windows-strings@0.1.0 X X
-windows-strings@0.4.2 X X
-windows-sys@0.52.0 X X
-windows-sys@0.59.0 X X
-windows-targets@0.52.6 X X
-windows_aarch64_gnullvm@0.52.6 X X
-windows_aarch64_msvc@0.52.6 X X
-windows_i686_gnu@0.52.6 X X
-windows_i686_gnullvm@0.52.6 X X
-windows_i686_msvc@0.52.6 X X
-windows_x86_64_gnu@0.52.6 X X
-windows_x86_64_gnullvm@0.52.6 X X
-windows_x86_64_msvc@0.52.6 X X
-wit-bindgen-rt@0.39.0 X X X
-writeable@0.6.1 X
-yoke@0.8.0 X
-yoke-derive@0.8.0 X
-zerocopy@0.8.26 X X X
-zerofrom@0.1.6 X
-zerofrom-derive@0.1.6 X
-zeroize@1.8.1 X X
-zerotrie@0.2.2 X
-zerovec@0.11.2 X
-zerovec-derive@0.11.1 X
diff --git a/integrations/cloud_filter/README.md b/integrations/cloud_filter/README.md
deleted file mode 100644
index 67a3c2e..0000000
--- a/integrations/cloud_filter/README.md
+++ /dev/null
@@ -1,90 +0,0 @@
-# Apache OpenDALâ„¢ Cloud Filter Integration
-
-[![Build Status]][actions] [![Latest Version]][crates.io] [![Crate Downloads]][crates.io] [![chat]][discord]
-
-[build status]: https://img.shields.io/github/actions/workflow/status/apache/opendal/test_behavior_integration_cloud_filter.yml?branch=main
-[actions]: https://github.com/apache/opendal/actions?query=branch%3Amain
-[latest version]: https://img.shields.io/crates/v/cloud_filter_opendal.svg
-[crates.io]: https://crates.io/crates/cloud_filter_opendal
-[crate downloads]: https://img.shields.io/crates/d/cloud_filter_opendal.svg
-[chat]: https://img.shields.io/discord/1081052318650339399
-[discord]: https://opendal.apache.org/discord
-
-`cloud_filter_opendal` integrates OpenDAL with [cloud sync engines](https://learn.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine). It provides a way to access various cloud storage on Windows.
-
-Note that `cloud_filter_opendal` is a read-only service, and it is not recommended to use it in production.
-
-## Example
-
-```rust
-use anyhow::Result;
-use cloud_filter::root::PopulationType;
-use cloud_filter::root::SecurityId;
-use cloud_filter::root::Session;
-use cloud_filter::root::SyncRootIdBuilder;
-use cloud_filter::root::SyncRootInfo;
-use opendal::services;
-use opendal::Operator;
-use tokio::runtime::Handle;
-use tokio::signal;
-
-#[tokio::main]
-async fn main() -> Result<()> {
- // Create any service desired
- let op = Operator::from_iter::<services::S3>([
- ("bucket".to_string(), "my_bucket".to_string()),
- ("access_key".to_string(), "my_access_key".to_string()),
- ("secret_key".to_string(), "my_secret_key".to_string()),
- ("endpoint".to_string(), "my_endpoint".to_string()),
- ("region".to_string(), "my_region".to_string()),
- ])?
- .finish();
-
- let client_path = std::env::var("CLIENT_PATH").expect("$CLIENT_PATH is set");
-
- // Create a sync root id
- let sync_root_id = SyncRootIdBuilder::new("cloud_filter_opendal")
- .user_security_id(SecurityId::current_user()?)
- .build();
-
- // Register the sync root if not exists
- if !sync_root_id.is_registered()? {
- sync_root_id.register(
- SyncRootInfo::default()
- .with_display_name("OpenDAL Cloud Filter")
- .with_population_type(PopulationType::Full)
- .with_icon("shell32.dll,3")
- .with_version("1.0.0")
- .with_recycle_bin_uri("http://cloudmirror.example.com/recyclebin")?
- .with_path(&client_path)?,
- )?;
- }
-
- let handle = Handle::current();
- let connection = Session::new().connect_async(
- &client_path,
- cloud_filter_opendal::CloudFilter::new(op, client_path.clone().into()),
- move |f| handle.block_on(f),
- )?;
-
- signal::ctrl_c().await?;
-
- // Drop the connection before unregister the sync root
- drop(connection);
- sync_root_id.unregister()?;
-
- Ok(())
-}
-```
-
-## Branding
-
-The first and most prominent mentions must use the full form: **Apache OpenDALâ„¢** of the name for any individual usage (webpage, handout, slides, etc.) Depending on the context and writing style, you should use the full form of the name sufficiently often to ensure that readers clearly understand the association of both the OpenDAL project and the OpenDAL software product to the ASF as the parent organization.
-
-For more details, see the [Apache Product Name Usage Guide](https://www.apache.org/foundation/marks/guide).
-
-## License and Trademarks
-
-Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
-
-Apache OpenDAL, OpenDAL, and Apache are either registered trademarks or trademarks of the Apache Software Foundation.
diff --git a/integrations/cloud_filter/examples/readonly.rs b/integrations/cloud_filter/examples/readonly.rs
deleted file mode 100644
index 465cbd3..0000000
--- a/integrations/cloud_filter/examples/readonly.rs
+++ /dev/null
@@ -1,74 +0,0 @@
-// 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.
-
-use std::env;
-
-use cloud_filter::root::{
- HydrationType, PopulationType, SecurityId, Session, SyncRootIdBuilder, SyncRootInfo,
-};
-use opendal::{Operator, services};
-use tokio::{runtime::Handle, signal};
-
-const PROVIDER_NAME: &str = "ro-cloud_filter";
-const DISPLAY_NAME: &str = "Read Only Cloud Filter";
-
-#[tokio::main]
-async fn main() {
- logforth::stderr().apply();
-
- let root = env::var("ROOT").expect("$ROOT is set");
- let client_path = env::var("CLIENT_PATH").expect("$CLIENT_PATH is set");
-
- let fs = services::Fs::default().root(&root);
-
- let op = Operator::new(fs).expect("build operator").finish();
-
- let sync_root_id = SyncRootIdBuilder::new(PROVIDER_NAME)
- .user_security_id(SecurityId::current_user().unwrap())
- .build();
-
- if !sync_root_id.is_registered().unwrap() {
- sync_root_id
- .register(
- SyncRootInfo::default()
- .with_display_name(DISPLAY_NAME)
- .with_hydration_type(HydrationType::Full)
- .with_population_type(PopulationType::Full)
- .with_icon("%SystemRoot%\\system32\\charmap.exe,0")
- .with_version("1.0.0")
- .with_recycle_bin_uri("http://cloudmirror.example.com/recyclebin")
- .unwrap()
- .with_path(&client_path)
- .unwrap(),
- )
- .unwrap();
- }
-
- let handle = Handle::current();
- let connection = Session::new()
- .connect_async(
- &client_path,
- cloud_filter_opendal::CloudFilter::new(op, client_path.clone().into()),
- move |f| handle.block_on(f),
- )
- .expect("create session");
-
- signal::ctrl_c().await.unwrap();
-
- drop(connection);
- sync_root_id.unregister().unwrap();
-}
diff --git a/integrations/cloud_filter/src/file.rs b/integrations/cloud_filter/src/file.rs
deleted file mode 100644
index cebacfa..0000000
--- a/integrations/cloud_filter/src/file.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// 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.
-
-use serde::{Deserialize, Serialize};
-
-#[derive(Debug, Clone, Default, Serialize, Deserialize)]
-pub struct FileBlob {
- pub etag: Option<String>,
- pub md5: Option<String>,
-}
diff --git a/integrations/cloud_filter/src/lib.rs b/integrations/cloud_filter/src/lib.rs
deleted file mode 100644
index 0a769ff..0000000
--- a/integrations/cloud_filter/src/lib.rs
+++ /dev/null
@@ -1,317 +0,0 @@
-// 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.
-
-//! `cloud_filter_opendal` integrates OpenDAL with [cloud sync engines](https://learn.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine).
-//! It provides a way to access various cloud storage on Windows.
-//!
-//! Note that `cloud_filter_opendal` is a read-only service, and it is not recommended to use it in production.
-//!
-//! # Example
-//!
-//! ```no_run
-//! use anyhow::Result;
-//! use cloud_filter::root::PopulationType;
-//! use cloud_filter::root::SecurityId;
-//! use cloud_filter::root::Session;
-//! use cloud_filter::root::SyncRootIdBuilder;
-//! use cloud_filter::root::SyncRootInfo;
-//! use opendal::services;
-//! use opendal::Operator;
-//! use tokio::runtime::Handle;
-//! use tokio::signal;
-//!
-//! #[tokio::main]
-//! async fn main() -> Result<()> {
-//! // Create any service desired
-//! let op = Operator::from_iter::<services::S3>([
-//! ("bucket".to_string(), "my_bucket".to_string()),
-//! ("access_key".to_string(), "my_access_key".to_string()),
-//! ("secret_key".to_string(), "my_secret_key".to_string()),
-//! ("endpoint".to_string(), "my_endpoint".to_string()),
-//! ("region".to_string(), "my_region".to_string()),
-//! ])?
-//! .finish();
-//!
-//! let client_path = std::env::var("CLIENT_PATH").expect("$CLIENT_PATH is set");
-//!
-//! // Create a sync root id
-//! let sync_root_id = SyncRootIdBuilder::new("cloud_filter_opendal")
-//! .user_security_id(SecurityId::current_user()?)
-//! .build();
-//!
-//! // Register the sync root if not exists
-//! if !sync_root_id.is_registered()? {
-//! sync_root_id.register(
-//! SyncRootInfo::default()
-//! .with_display_name("OpenDAL Cloud Filter")
-//! .with_population_type(PopulationType::Full)
-//! .with_icon("shell32.dll,3")
-//! .with_version("1.0.0")
-//! .with_recycle_bin_uri("http://cloudmirror.example.com/recyclebin")?
-//! .with_path(&client_path)?,
-//! )?;
-//! }
-//!
-//! let handle = Handle::current();
-//! let connection = Session::new().connect_async(
-//! &client_path,
-//! cloud_filter_opendal::CloudFilter::new(op, client_path.clone().into()),
-//! move |f| handle.block_on(f),
-//! )?;
-//!
-//! signal::ctrl_c().await?;
-//!
-//! // Drop the connection before unregister the sync root
-//! drop(connection);
-//! sync_root_id.unregister()?;
-//!
-//! Ok(())
-//! }
-//! ``````
-
-mod file;
-
-use std::{
- cmp::min,
- fs::{self, File},
- path::{Path, PathBuf},
-};
-
-use cloud_filter::{
- error::{CResult, CloudErrorKind},
- filter::{Filter, Request, info, ticket},
- metadata::Metadata,
- placeholder::{ConvertOptions, Placeholder},
- placeholder_file::PlaceholderFile,
- utility::{FileTime, WriteAt},
-};
-use file::FileBlob;
-use futures::StreamExt;
-use opendal::{Entry, Operator};
-
-const BUF_SIZE: usize = 65536;
-
-/// CloudFilter is a adapter that adapts Windows cloud sync engines.
-pub struct CloudFilter {
- op: Operator,
- root: PathBuf,
-}
-
-impl CloudFilter {
- /// Create a new CloudFilter.
- pub fn new(op: Operator, root: PathBuf) -> Self {
- Self { op, root }
- }
-}
-
-impl Filter for CloudFilter {
- async fn fetch_data(
- &self,
- request: Request,
- ticket: ticket::FetchData,
- info: info::FetchData,
- ) -> CResult<()> {
- log::debug!("fetch_data: {}", request.path().display());
-
- let _blob = bincode::deserialize::<FileBlob>(request.file_blob()).map_err(|e| {
- log::warn!("failed to deserialize file blob: {e}");
- CloudErrorKind::ValidationFailed
- })?;
-
- let range = info.required_file_range();
- let path = request.path();
- let remote_path = path
- .strip_prefix(&self.root)
- .map_err(|_| CloudErrorKind::NotUnderSyncRoot)?;
-
- let reader = self
- .op
- .reader_with(&remote_path.to_string_lossy().replace('\\', "/"))
- .await
- .map_err(|e| {
- log::warn!("failed to open file: {e}");
- CloudErrorKind::Unsuccessful
- })?;
-
- let mut position = range.start;
- let mut buffer = Vec::with_capacity(BUF_SIZE);
-
- loop {
- let mut bytes_read = reader
- .read_into(
- &mut buffer,
- position..min(range.end, position + BUF_SIZE as u64),
- )
- .await
- .map_err(|e| {
- log::warn!("failed to read file: {e}");
- CloudErrorKind::Unsuccessful
- })?;
-
- let unaligned = bytes_read % 4096;
- if unaligned != 0 && position + (bytes_read as u64) < range.end {
- bytes_read -= unaligned;
- }
-
- ticket
- .write_at(&buffer[..bytes_read], position)
- .map_err(|e| {
- log::warn!("failed to write file: {e}");
- CloudErrorKind::Unsuccessful
- })?;
- position += bytes_read as u64;
-
- if position >= range.end {
- break;
- }
-
- buffer.clear();
-
- ticket.report_progress(range.end, position).map_err(|e| {
- log::warn!("failed to report progress: {e}");
- CloudErrorKind::Unsuccessful
- })?;
- }
-
- Ok(())
- }
-
- async fn fetch_placeholders(
- &self,
- request: Request,
- ticket: ticket::FetchPlaceholders,
- _info: info::FetchPlaceholders,
- ) -> CResult<()> {
- log::debug!("fetch_placeholders: {}", request.path().display());
-
- let absolute = request.path();
- let mut remote_path = absolute
- .strip_prefix(&self.root)
- .map_err(|_| CloudErrorKind::NotUnderSyncRoot)?
- .to_owned();
- remote_path.push("");
-
- let now = FileTime::now();
- let mut entries = self
- .op
- .lister_with(&remote_path.to_string_lossy().replace('\\', "/"))
- .await
- .map_err(|e| {
- log::warn!("failed to list files: {e}");
- CloudErrorKind::Unsuccessful
- })?
- .filter_map(|e| async {
- let entry = e.ok()?;
- let metadata = self.op.stat(entry.path()).await.ok()?;
- let entry_remote_path = PathBuf::from(entry.path());
- let relative_path = entry_remote_path
- .strip_prefix(&remote_path)
- .expect("valid path");
- check_in_sync(&entry, &self.root).then(|| {
- PlaceholderFile::new(relative_path)
- .metadata(
- match entry.metadata().is_dir() {
- true => Metadata::directory(),
- false => Metadata::file(),
- }
- .size(metadata.content_length())
- .written(
- FileTime::from_unix_time(
- metadata
- .last_modified()
- .unwrap_or_default()
- .into_inner()
- .as_second(),
- )
- .expect("valid time"),
- )
- .created(now),
- )
- .mark_in_sync()
- .blob(
- bincode::serialize(&FileBlob {
- ..Default::default()
- })
- .expect("valid blob"),
- )
- })
- })
- .collect::<Vec<_>>()
- .await;
-
- _ = ticket.pass_with_placeholder(&mut entries).map_err(|e| {
- log::warn!("failed to pass placeholder: {e:?}");
- });
-
- Ok(())
- }
-}
-
-/// Checks if the entry is in sync, then convert to placeholder.
-///
-/// Returns `true` if the entry is not exists, `false` otherwise.
-fn check_in_sync(entry: &Entry, root: &Path) -> bool {
- let absolute = root.join(entry.path());
-
- let Ok(metadata) = fs::metadata(&absolute) else {
- return true;
- };
-
- if metadata.is_dir() != entry.metadata().is_dir() {
- return false;
- } else if metadata.is_file() {
- // FIXME: checksum
- if entry.metadata().content_length() != metadata.len() {
- return false;
- }
- }
-
- if metadata.is_dir() {
- let mut placeholder = Placeholder::open(absolute).unwrap();
- _ = placeholder
- .convert_to_placeholder(
- ConvertOptions::default()
- .mark_in_sync()
- .has_children()
- .blob(
- bincode::serialize(&FileBlob {
- ..Default::default()
- })
- .expect("valid blob"),
- ),
- None,
- )
- .map_err(|e| {
- log::error!("failed to convert to placeholder: {e:?}");
- });
- } else {
- let mut placeholder = Placeholder::from(File::open(absolute).unwrap());
- _ = placeholder
- .convert_to_placeholder(
- ConvertOptions::default().mark_in_sync().blob(
- bincode::serialize(&FileBlob {
- ..Default::default()
- })
- .expect("valid blob"),
- ),
- None,
- )
- .map_err(|e| log::error!("failed to convert to placeholder: {e:?}"));
- }
-
- false
-}
diff --git a/integrations/cloud_filter/tests/behavior/README.md b/integrations/cloud_filter/tests/behavior/README.md
deleted file mode 100644
index f682810..0000000
--- a/integrations/cloud_filter/tests/behavior/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Behavior tests for OpenDALâ„¢ Cloud Filter Integration
-
-Behavior tests are used to make sure every service works correctly.
-
-`cloud_filter_opendal` is readonly currently, so we assume `fixtures/data` is the root of the test data.
-
-## Run
-
-```pwsh
-cd .\integrations\cloud_filter
-$env:OPENDAL_TEST='fs'; $env:OPENDAL_FS_ROOT='../../fixtures/data'; $env:OPENDAL_DISABLE_RANDOM_ROOT='true'; cargo test --test behavior
-```
diff --git a/integrations/cloud_filter/tests/behavior/fetch_data.rs b/integrations/cloud_filter/tests/behavior/fetch_data.rs
deleted file mode 100644
index accd2fb..0000000
--- a/integrations/cloud_filter/tests/behavior/fetch_data.rs
+++ /dev/null
@@ -1,51 +0,0 @@
-// 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.
-
-use libtest_mimic::Failed;
-
-use crate::{
- ROOT_PATH,
- utils::{file_content, file_length},
-};
-
-pub fn test_fetch_data() -> Result<(), Failed> {
- let files = [
- (
- "normal_file.txt",
- include_str!("..\\..\\..\\..\\fixtures/data/normal_file.txt"),
- ),
- (
- "special_file !@#$%^&()_+-=;',.txt",
- include_str!("..\\..\\..\\..\\fixtures/data/special_file !@#$%^&()_+-=;',.txt"),
- ),
- ];
- for (file, expected_content) in files {
- let path = format!("{ROOT_PATH}\\{file}");
- assert_eq!(
- expected_content.len(),
- file_length(&path).expect("file length"),
- "file length",
- );
-
- assert_eq!(
- expected_content,
- file_content(&path).expect("file content"),
- "file content",
- )
- }
- Ok(())
-}
diff --git a/integrations/cloud_filter/tests/behavior/fetch_placeholder.rs b/integrations/cloud_filter/tests/behavior/fetch_placeholder.rs
deleted file mode 100644
index b8c37e5..0000000
--- a/integrations/cloud_filter/tests/behavior/fetch_placeholder.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-// 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.
-
-use libtest_mimic::Failed;
-
-use crate::{ROOT_PATH, utils::list};
-
-pub fn test_fetch_placeholder() -> Result<(), Failed> {
- let files = ["normal_file.txt", "special_file !@#$%^&()_+-=;',.txt"];
- let dirs = ["normal_dir", "special_dir !@#$%^&()_+-=;',"];
-
- assert_eq!(
- list(ROOT_PATH, "File").expect("list files"),
- files,
- "list files"
- );
- assert_eq!(
- list(ROOT_PATH, "Directory").expect("list dirs"),
- dirs,
- "list dirs"
- );
-
- Ok(())
-}
diff --git a/integrations/cloud_filter/tests/behavior/main.rs b/integrations/cloud_filter/tests/behavior/main.rs
deleted file mode 100644
index acb01b0..0000000
--- a/integrations/cloud_filter/tests/behavior/main.rs
+++ /dev/null
@@ -1,118 +0,0 @@
-// 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.
-
-mod fetch_data;
-mod fetch_placeholder;
-mod utils;
-
-use std::{
- fs,
- future::Future,
- path::{Path, PathBuf},
- pin::Pin,
- process::ExitCode,
-};
-
-use cloud_filter::{
- filter::AsyncBridge,
- root::{
- Connection, HydrationType, PopulationType, SecurityId, Session, SyncRootId,
- SyncRootIdBuilder, SyncRootInfo,
- },
-};
-use cloud_filter_opendal::CloudFilter;
-use libtest_mimic::{Arguments, Trial};
-use opendal::{Operator, raw::tests};
-use tokio::runtime::Handle;
-
-const PROVIDER_NAME: &str = "ro-cloud_filter";
-const DISPLAY_NAME: &str = "Test Cloud Filter";
-const ROOT_PATH: &str = "C:\\sync_root";
-
-type Callback = Pin<Box<dyn Future<Output = ()>>>;
-
-#[tokio::main]
-async fn main() -> ExitCode {
- let args = Arguments::from_args();
-
- logforth::stderr().apply();
-
- let Ok(Some(op)) = tests::init_test_service() else {
- return ExitCode::SUCCESS;
- };
-
- if !Path::new(ROOT_PATH).try_exists().expect("try exists") {
- fs::create_dir(ROOT_PATH).expect("create root dir");
- }
-
- let (sync_root_id, connection) = init(op);
-
- let tests = vec![
- Trial::test("fetch_data", fetch_data::test_fetch_data),
- Trial::test(
- "fetch_placeholder",
- fetch_placeholder::test_fetch_placeholder,
- ),
- ];
-
- let conclusion = libtest_mimic::run(&args, tests);
-
- drop(connection);
- sync_root_id.unregister().unwrap();
- fs::remove_dir_all(ROOT_PATH).expect("remove root dir");
-
- conclusion.exit_code()
-}
-
-fn init(
- op: Operator,
-) -> (
- SyncRootId,
- Connection<AsyncBridge<CloudFilter, impl Fn(Callback)>>,
-) {
- let sync_root_id = SyncRootIdBuilder::new(PROVIDER_NAME)
- .user_security_id(SecurityId::current_user().unwrap())
- .build();
-
- if !sync_root_id.is_registered().unwrap() {
- sync_root_id
- .register(
- SyncRootInfo::default()
- .with_display_name(DISPLAY_NAME)
- .with_hydration_type(HydrationType::Full)
- .with_population_type(PopulationType::Full)
- .with_icon("%SystemRoot%\\system32\\charmap.exe,0")
- .with_version("1.0.0")
- .with_recycle_bin_uri("http://cloudmirror.example.com/recyclebin")
- .unwrap()
- .with_path(ROOT_PATH)
- .unwrap(),
- )
- .unwrap();
- }
-
- let handle = Handle::current();
- let connection = Session::new()
- .connect_async(
- ROOT_PATH,
- CloudFilter::new(op, PathBuf::from(&ROOT_PATH)),
- move |f| handle.clone().block_on(f),
- )
- .expect("create session");
-
- (sync_root_id, connection)
-}
diff --git a/integrations/cloud_filter/tests/behavior/utils.rs b/integrations/cloud_filter/tests/behavior/utils.rs
deleted file mode 100644
index 105cc40..0000000
--- a/integrations/cloud_filter/tests/behavior/utils.rs
+++ /dev/null
@@ -1,51 +0,0 @@
-// 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.
-
-use std::fmt::Display;
-
-use anyhow::Context;
-
-pub fn file_length(path: impl Display) -> anyhow::Result<usize> {
- let len = powershell_script::run(&format!("(Get-Item \"{path}\" -Force).Length"))
- .context("run powershell")?
- .stdout()
- .unwrap_or_default()
- .trim()
- .parse()
- .context("parse length")?;
-
- Ok(len)
-}
-
-pub fn file_content(path: impl Display) -> anyhow::Result<String> {
- let content = powershell_script::run(&format!("Get-Content \"{path}\""))
- .context("run powershell")?
- .stdout()
- .unwrap_or_default();
- Ok(content)
-}
-
-pub fn list(path: impl Display, option: impl Display) -> anyhow::Result<Vec<String>> {
- let entries = powershell_script::run(&format!("(Get-ChildItem \"{path}\" -{option}).Name"))
- .context("run powershell")?
- .stdout()
- .unwrap_or_default()
- .lines()
- .map(Into::into)
- .collect();
- Ok(entries)
-}
diff --git a/src/main.rs b/src/main.rs
index 6edf6b4..0b01e0e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -104,74 +104,3 @@ async fn execute(cfg: Config) -> Result<()> {
Ok(())
}
-
-#[cfg(target_os = "windows")]
-async fn execute(cfg: Config) -> Result<()> {
- use anyhow::Context;
- use cloud_filter::root::HydrationType;
- use cloud_filter::root::PopulationType;
- use cloud_filter::root::SecurityId;
- use cloud_filter::root::Session;
- use cloud_filter::root::SyncRootIdBuilder;
- use cloud_filter::root::SyncRootInfo;
- use opendal::Operator;
- use std::path::PathBuf;
- use tokio::runtime::Handle;
- use tokio::signal;
-
- const PROVIDER_NAME: &str = "ofs";
-
- if cfg.backend.has_host() {
- log::warn!("backend host will be ignored");
- }
-
- let scheme_str = cfg.backend.scheme();
- let op_args = cfg.backend.query_pairs().into_owned();
-
- let backend = Operator::via_iter(scheme_str, op_args)
- .with_context(|| format!("invalid scheme or arguments for {scheme_str}"))?;
-
- let sync_root_id = SyncRootIdBuilder::new(PROVIDER_NAME)
- .user_security_id(
- SecurityId::current_user().expect("get current user security id, it might be a bug"),
- )
- .build();
-
- if !sync_root_id
- .is_registered()
- .expect("check if sync root is registered, it might be a bug")
- {
- sync_root_id
- .register(
- SyncRootInfo::default()
- .with_display_name(format!("ofs ({scheme_str})"))
- .with_hydration_type(HydrationType::Full)
- .with_population_type(PopulationType::Full)
- .with_icon("%SystemRoot%\\system32\\charmap.exe,0")
- .with_version(env!("CARGO_PKG_VERSION"))
- .with_recycle_bin_uri("http://cloudmirror.example.com/recyclebin") // FIXME
- .unwrap()
- .with_path(&cfg.mount_path)
- .context("mount_path is not a folder")?,
- )
- .context("failed to register sync root")?;
- }
-
- let handle = Handle::current();
- let connection = Session::new()
- .connect_async(
- &cfg.mount_path,
- cloudfilter_opendal::CloudFilter::new(backend, PathBuf::from(&cfg.mount_path)),
- move |f| handle.clone().block_on(f),
- )
- .context("failed to connect to sync root")?;
-
- signal::ctrl_c().await.unwrap();
-
- drop(connection);
- sync_root_id
- .unregister()
- .context("failed to unregister sync root")?;
-
- Ok(())
-}