opendal 0.1.6.pre.rc.1-aarch64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.standard.yml +20 -0
- data/.tool-versions +1 -0
- data/.yardopts +1 -0
- data/DEPENDENCIES.md +9 -0
- data/DEPENDENCIES.rust.tsv +277 -0
- data/Gemfile +35 -0
- data/README.md +159 -0
- data/Rakefile +149 -0
- data/core/CHANGELOG.md +4929 -0
- data/core/CONTRIBUTING.md +61 -0
- data/core/DEPENDENCIES.md +3 -0
- data/core/DEPENDENCIES.rust.tsv +185 -0
- data/core/LICENSE +201 -0
- data/core/README.md +228 -0
- data/core/benches/README.md +18 -0
- data/core/benches/ops/README.md +26 -0
- data/core/benches/types/README.md +9 -0
- data/core/benches/vs_fs/README.md +35 -0
- data/core/benches/vs_s3/README.md +55 -0
- data/core/edge/README.md +3 -0
- data/core/edge/file_write_on_full_disk/README.md +14 -0
- data/core/edge/s3_aws_assume_role_with_web_identity/README.md +18 -0
- data/core/edge/s3_read_on_wasm/.gitignore +3 -0
- data/core/edge/s3_read_on_wasm/README.md +42 -0
- data/core/edge/s3_read_on_wasm/webdriver.json +15 -0
- data/core/examples/README.md +23 -0
- data/core/examples/basic/README.md +15 -0
- data/core/examples/concurrent-upload/README.md +15 -0
- data/core/examples/multipart-upload/README.md +15 -0
- data/core/fuzz/.gitignore +5 -0
- data/core/fuzz/README.md +68 -0
- data/core/src/docs/comparisons/vs_object_store.md +183 -0
- data/core/src/docs/performance/concurrent_write.md +101 -0
- data/core/src/docs/performance/http_optimization.md +124 -0
- data/core/src/docs/rfcs/0000_example.md +74 -0
- data/core/src/docs/rfcs/0000_foyer_integration.md +111 -0
- data/core/src/docs/rfcs/0041_object_native_api.md +185 -0
- data/core/src/docs/rfcs/0044_error_handle.md +198 -0
- data/core/src/docs/rfcs/0057_auto_region.md +160 -0
- data/core/src/docs/rfcs/0069_object_stream.md +145 -0
- data/core/src/docs/rfcs/0090_limited_reader.md +155 -0
- data/core/src/docs/rfcs/0112_path_normalization.md +79 -0
- data/core/src/docs/rfcs/0191_async_streaming_io.md +328 -0
- data/core/src/docs/rfcs/0203_remove_credential.md +96 -0
- data/core/src/docs/rfcs/0221_create_dir.md +89 -0
- data/core/src/docs/rfcs/0247_retryable_error.md +87 -0
- data/core/src/docs/rfcs/0293_object_id.md +67 -0
- data/core/src/docs/rfcs/0337_dir_entry.md +191 -0
- data/core/src/docs/rfcs/0409_accessor_capabilities.md +67 -0
- data/core/src/docs/rfcs/0413_presign.md +154 -0
- data/core/src/docs/rfcs/0423_command_line_interface.md +268 -0
- data/core/src/docs/rfcs/0429_init_from_iter.md +107 -0
- data/core/src/docs/rfcs/0438_multipart.md +163 -0
- data/core/src/docs/rfcs/0443_gateway.md +73 -0
- data/core/src/docs/rfcs/0501_new_builder.md +111 -0
- data/core/src/docs/rfcs/0554_write_refactor.md +96 -0
- data/core/src/docs/rfcs/0561_list_metadata_reuse.md +210 -0
- data/core/src/docs/rfcs/0599_blocking_api.md +157 -0
- data/core/src/docs/rfcs/0623_redis_service.md +300 -0
- data/core/src/docs/rfcs/0627_split_capabilities.md +89 -0
- data/core/src/docs/rfcs/0661_path_in_accessor.md +126 -0
- data/core/src/docs/rfcs/0793_generic_kv_services.md +209 -0
- data/core/src/docs/rfcs/0926_object_reader.md +93 -0
- data/core/src/docs/rfcs/0977_refactor_error.md +151 -0
- data/core/src/docs/rfcs/1085_object_handler.md +73 -0
- data/core/src/docs/rfcs/1391_object_metadataer.md +110 -0
- data/core/src/docs/rfcs/1398_query_based_metadata.md +125 -0
- data/core/src/docs/rfcs/1420_object_writer.md +147 -0
- data/core/src/docs/rfcs/1477_remove_object_concept.md +159 -0
- data/core/src/docs/rfcs/1735_operation_extension.md +117 -0
- data/core/src/docs/rfcs/2083_writer_sink_api.md +106 -0
- data/core/src/docs/rfcs/2133_append_api.md +88 -0
- data/core/src/docs/rfcs/2299_chain_based_operator_api.md +99 -0
- data/core/src/docs/rfcs/2602_object_versioning.md +138 -0
- data/core/src/docs/rfcs/2758_merge_append_into_write.md +79 -0
- data/core/src/docs/rfcs/2774_lister_api.md +66 -0
- data/core/src/docs/rfcs/2779_list_with_metakey.md +143 -0
- data/core/src/docs/rfcs/2852_native_capability.md +58 -0
- data/core/src/docs/rfcs/2884_merge_range_read_into_read.md +80 -0
- data/core/src/docs/rfcs/3017_remove_write_copy_from.md +94 -0
- data/core/src/docs/rfcs/3197_config.md +237 -0
- data/core/src/docs/rfcs/3232_align_list_api.md +69 -0
- data/core/src/docs/rfcs/3243_list_prefix.md +128 -0
- data/core/src/docs/rfcs/3356_lazy_reader.md +111 -0
- data/core/src/docs/rfcs/3526_list_recursive.md +59 -0
- data/core/src/docs/rfcs/3574_concurrent_stat_in_list.md +80 -0
- data/core/src/docs/rfcs/3734_buffered_reader.md +64 -0
- data/core/src/docs/rfcs/3898_concurrent_writer.md +66 -0
- data/core/src/docs/rfcs/3911_deleter_api.md +165 -0
- data/core/src/docs/rfcs/4382_range_based_read.md +213 -0
- data/core/src/docs/rfcs/4638_executor.md +215 -0
- data/core/src/docs/rfcs/5314_remove_metakey.md +120 -0
- data/core/src/docs/rfcs/5444_operator_from_uri.md +162 -0
- data/core/src/docs/rfcs/5479_context.md +140 -0
- data/core/src/docs/rfcs/5485_conditional_reader.md +112 -0
- data/core/src/docs/rfcs/5495_list_with_deleted.md +81 -0
- data/core/src/docs/rfcs/5556_write_returns_metadata.md +121 -0
- data/core/src/docs/rfcs/5871_read_returns_metadata.md +112 -0
- data/core/src/docs/rfcs/6189_remove_native_blocking.md +106 -0
- data/core/src/docs/rfcs/6209_glob_support.md +132 -0
- data/core/src/docs/rfcs/6213_options_api.md +142 -0
- data/core/src/docs/rfcs/README.md +62 -0
- data/core/src/docs/upgrade.md +1556 -0
- data/core/src/services/aliyun_drive/docs.md +61 -0
- data/core/src/services/alluxio/docs.md +45 -0
- data/core/src/services/azblob/docs.md +77 -0
- data/core/src/services/azdls/docs.md +73 -0
- data/core/src/services/azfile/docs.md +65 -0
- data/core/src/services/b2/docs.md +54 -0
- data/core/src/services/cacache/docs.md +38 -0
- data/core/src/services/cloudflare_kv/docs.md +21 -0
- data/core/src/services/cos/docs.md +55 -0
- data/core/src/services/d1/docs.md +48 -0
- data/core/src/services/dashmap/docs.md +38 -0
- data/core/src/services/dbfs/docs.md +57 -0
- data/core/src/services/dropbox/docs.md +64 -0
- data/core/src/services/etcd/docs.md +45 -0
- data/core/src/services/foundationdb/docs.md +42 -0
- data/core/src/services/fs/docs.md +49 -0
- data/core/src/services/ftp/docs.md +42 -0
- data/core/src/services/gcs/docs.md +76 -0
- data/core/src/services/gdrive/docs.md +65 -0
- data/core/src/services/ghac/docs.md +84 -0
- data/core/src/services/github/docs.md +52 -0
- data/core/src/services/gridfs/docs.md +46 -0
- data/core/src/services/hdfs/docs.md +140 -0
- data/core/src/services/hdfs_native/docs.md +35 -0
- data/core/src/services/http/docs.md +45 -0
- data/core/src/services/huggingface/docs.md +61 -0
- data/core/src/services/ipfs/docs.md +45 -0
- data/core/src/services/ipmfs/docs.md +14 -0
- data/core/src/services/koofr/docs.md +51 -0
- data/core/src/services/lakefs/docs.md +62 -0
- data/core/src/services/memcached/docs.md +47 -0
- data/core/src/services/memory/docs.md +36 -0
- data/core/src/services/mini_moka/docs.md +19 -0
- data/core/src/services/moka/docs.md +42 -0
- data/core/src/services/mongodb/docs.md +49 -0
- data/core/src/services/monoiofs/docs.md +46 -0
- data/core/src/services/mysql/docs.md +47 -0
- data/core/src/services/obs/docs.md +54 -0
- data/core/src/services/onedrive/docs.md +115 -0
- data/core/src/services/opfs/docs.md +18 -0
- data/core/src/services/oss/docs.md +74 -0
- data/core/src/services/pcloud/docs.md +51 -0
- data/core/src/services/persy/docs.md +43 -0
- data/core/src/services/postgresql/docs.md +47 -0
- data/core/src/services/redb/docs.md +41 -0
- data/core/src/services/redis/docs.md +43 -0
- data/core/src/services/rocksdb/docs.md +54 -0
- data/core/src/services/s3/compatible_services.md +126 -0
- data/core/src/services/s3/docs.md +244 -0
- data/core/src/services/seafile/docs.md +54 -0
- data/core/src/services/sftp/docs.md +49 -0
- data/core/src/services/sled/docs.md +39 -0
- data/core/src/services/sqlite/docs.md +46 -0
- data/core/src/services/surrealdb/docs.md +54 -0
- data/core/src/services/swift/compatible_services.md +53 -0
- data/core/src/services/swift/docs.md +52 -0
- data/core/src/services/tikv/docs.md +43 -0
- data/core/src/services/upyun/docs.md +51 -0
- data/core/src/services/vercel_artifacts/docs.md +40 -0
- data/core/src/services/vercel_blob/docs.md +45 -0
- data/core/src/services/webdav/docs.md +49 -0
- data/core/src/services/webhdfs/docs.md +90 -0
- data/core/src/services/yandex_disk/docs.md +45 -0
- data/core/tests/behavior/README.md +77 -0
- data/core/tests/data/normal_dir/.gitkeep +0 -0
- data/core/tests/data/normal_file.txt +1041 -0
- data/core/tests/data/special_dir !@#$%^&()_+-=;',/.gitkeep +0 -0
- data/core/tests/data/special_file !@#$%^&()_+-=;',.txt +1041 -0
- data/core/users.md +13 -0
- data/extconf.rb +24 -0
- data/lib/opendal.rb +25 -0
- data/lib/opendal_ruby/entry.rb +35 -0
- data/lib/opendal_ruby/io.rb +70 -0
- data/lib/opendal_ruby/metadata.rb +44 -0
- data/lib/opendal_ruby/opendal_ruby.so +0 -0
- data/lib/opendal_ruby/operator.rb +29 -0
- data/lib/opendal_ruby/operator_info.rb +26 -0
- data/opendal.gemspec +91 -0
- data/test/blocking_op_test.rb +112 -0
- data/test/capability_test.rb +42 -0
- data/test/io_test.rb +172 -0
- data/test/lister_test.rb +77 -0
- data/test/metadata_test.rb +78 -0
- data/test/middlewares_test.rb +46 -0
- data/test/operator_info_test.rb +35 -0
- data/test/test_helper.rb +36 -0
- metadata +240 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
## Capabilities
|
|
2
|
+
|
|
3
|
+
This service can be used to:
|
|
4
|
+
|
|
5
|
+
- [x] stat
|
|
6
|
+
- [x] read
|
|
7
|
+
- [x] write
|
|
8
|
+
- [ ] append
|
|
9
|
+
- [x] create_dir
|
|
10
|
+
- [x] delete
|
|
11
|
+
- [x] copy
|
|
12
|
+
- [x] rename
|
|
13
|
+
- [x] list
|
|
14
|
+
- [ ] presign
|
|
15
|
+
- [ ] blocking
|
|
16
|
+
|
|
17
|
+
## Notes
|
|
18
|
+
|
|
19
|
+
Currently, OpenDAL supports OneDrive Personal only.
|
|
20
|
+
|
|
21
|
+
### Write Operations and OneDrive Behavior
|
|
22
|
+
|
|
23
|
+
For write-related operations, such as:
|
|
24
|
+
|
|
25
|
+
- write
|
|
26
|
+
- rename
|
|
27
|
+
- copy
|
|
28
|
+
- create_dir
|
|
29
|
+
|
|
30
|
+
OpenDAL's OneDrive service replaces the destination folder instead of rename it.
|
|
31
|
+
|
|
32
|
+
### Consistency Issues with Concurrent Requests
|
|
33
|
+
|
|
34
|
+
OneDrive does not guarantee consistency when handling a large number of concurrent requests write operations.
|
|
35
|
+
|
|
36
|
+
In some extreme cases, OneDrive may acknowledge an operation as successful but fail to commit the changes.
|
|
37
|
+
This inconsistency can cause subsequent operations to fail, returning errors like:
|
|
38
|
+
|
|
39
|
+
- 400 Bad Request: OneDrive considers folders in the path are not there yet
|
|
40
|
+
- 404 Not Found: OneDrive doesn't recognize the created folder
|
|
41
|
+
- 409 Conflict: OneDrive can't replace an existing folder
|
|
42
|
+
|
|
43
|
+
You should consider [`RetryLayer`] and monitor your operations carefully.
|
|
44
|
+
|
|
45
|
+
## Configuration
|
|
46
|
+
|
|
47
|
+
- `access_token`: Set a short-live access token for Microsoft Graph API (also, OneDrive API)
|
|
48
|
+
- `refresh_token`: Set a long term access token for Microsoft Graph API
|
|
49
|
+
- `client_id`: Set the client ID for a Microsoft Graph API application (available though Azure's registration portal)
|
|
50
|
+
- `client_secret`: Set the client secret for a Microsoft Graph API application
|
|
51
|
+
- `root`: Set the work directory for OneDrive backend
|
|
52
|
+
- `enable_versioning`: Enable versioning support for OneDrive items
|
|
53
|
+
|
|
54
|
+
The configuration for tokens is one of the following:
|
|
55
|
+
* `access_token` only, for short-lived access. Once the `access_token` expires, you must recreate the operator with a new token.
|
|
56
|
+
* `refresh_token`, `client_id`, and an optional `client_secret`, for long-lived access. The operator will automatically get and refresh the access token.
|
|
57
|
+
|
|
58
|
+
## How to get tokens
|
|
59
|
+
|
|
60
|
+
1. Create an application: navigate to [Microsoft Entra Admin Center](https://entra.microsoft.com/) -> Applications -> App Registrations -> New registration
|
|
61
|
+
2. In "Supported account types", choose "Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)"
|
|
62
|
+
3. Or in an existing application -> manifest, make sure `signInAudience` is `"AzureADandPersonalMicrosoftAccount"`. That's because we're calling Graph API with `/common` path segment.
|
|
63
|
+
4. The platform you choose determines whether you have to provide a `client_secret` or not. See [Public and confidential client apps](https://learn.microsoft.com/en-us/entra/identity-platform/msal-client-applications) for more information.
|
|
64
|
+
1. In short, if you choose "Mobile and desktop applications" or "Single-page application" (Public Client), you must not provide `client_secret`.
|
|
65
|
+
2. If you choose "Web" (Confidential Client), create a secret in "Certificates & secrets -> Client secrets -> New client secret", and provide it as `client_secret`.
|
|
66
|
+
5. Follow the [code grant flow](https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow) or other flows to get the access_token. The minimum scope is `Files.ReadWrite`. And make sure the access token represents a user, because it's accessing the user's onedrive by `/me/drive`. So "client credentials flow" won't work.
|
|
67
|
+
6. If you need `refresh_token` for long-lived access, add an additional `offline_access` scope.
|
|
68
|
+
|
|
69
|
+
Read more at [`OnedriveBuilder`].
|
|
70
|
+
|
|
71
|
+
## Example
|
|
72
|
+
|
|
73
|
+
### Via Builder
|
|
74
|
+
|
|
75
|
+
When you have a current access token:
|
|
76
|
+
|
|
77
|
+
```rust,no_run
|
|
78
|
+
use anyhow::Result;
|
|
79
|
+
use opendal::services::Onedrive;
|
|
80
|
+
use opendal::Operator;
|
|
81
|
+
|
|
82
|
+
#[tokio::main]
|
|
83
|
+
async fn main() -> Result<()> {
|
|
84
|
+
// create backend builder
|
|
85
|
+
let mut builder = Onedrive::default()
|
|
86
|
+
.access_token("my_access_token")
|
|
87
|
+
.root("/root/folder/for/operator");
|
|
88
|
+
|
|
89
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
90
|
+
Ok(())
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
When you have an Application with a refresh token:
|
|
95
|
+
|
|
96
|
+
```rust,no_run
|
|
97
|
+
use anyhow::Result;
|
|
98
|
+
use opendal::services::Onedrive;
|
|
99
|
+
use opendal::Operator;
|
|
100
|
+
|
|
101
|
+
#[tokio::main]
|
|
102
|
+
async fn main() -> Result<()> {
|
|
103
|
+
// create backend builder
|
|
104
|
+
let mut builder = Onedrive::default()
|
|
105
|
+
.refresh_token("my_refresh_token")
|
|
106
|
+
.client_id("my_client_id")
|
|
107
|
+
.root("/root/folder/for/operator");
|
|
108
|
+
|
|
109
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
110
|
+
Ok(())
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
[conflict-behavior]: https://learn.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0#instance-attributes
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# Capabilities
|
|
4
|
+
|
|
5
|
+
This service can be used to:
|
|
6
|
+
|
|
7
|
+
- [x] stat
|
|
8
|
+
- [x] read
|
|
9
|
+
- [x] write
|
|
10
|
+
- [x] append
|
|
11
|
+
- [x] create_dir
|
|
12
|
+
- [x] delete
|
|
13
|
+
- [x] copy
|
|
14
|
+
- [ ] rename
|
|
15
|
+
- [x] list
|
|
16
|
+
- [x] presign
|
|
17
|
+
- [ ] blocking
|
|
18
|
+
|
|
19
|
+
# Configuration
|
|
20
|
+
|
|
21
|
+
- `root`: Set the work dir for backend.
|
|
22
|
+
- `bucket`: Set the container name for backend.
|
|
23
|
+
- `endpoint`: Set the endpoint for backend.
|
|
24
|
+
- `addressing_style`: Set the addressing style for endpoint.
|
|
25
|
+
- `presign_endpoint`: Set the endpoint for presign.
|
|
26
|
+
- `presign_addressing_style`: Set the addressing style for presign endpoint.
|
|
27
|
+
- `access_key_id`: Set the access_key_id for backend.
|
|
28
|
+
- `access_key_secret`: Set the access_key_secret for backend.
|
|
29
|
+
- `role_arn`: Set the role of backend.
|
|
30
|
+
- `oidc_token`: Set the oidc_token for backend.
|
|
31
|
+
- `allow_anonymous`: Set the backend access OSS in anonymous way.
|
|
32
|
+
|
|
33
|
+
Refer to [`OssBuilder`]'s public API docs for more information.
|
|
34
|
+
|
|
35
|
+
# Example
|
|
36
|
+
|
|
37
|
+
## Via Builder
|
|
38
|
+
|
|
39
|
+
```rust,no_run
|
|
40
|
+
use std::sync::Arc;
|
|
41
|
+
|
|
42
|
+
use anyhow::Result;
|
|
43
|
+
use opendal::services::Oss;
|
|
44
|
+
use opendal::Operator;
|
|
45
|
+
|
|
46
|
+
#[tokio::main]
|
|
47
|
+
async fn main() -> Result<()> {
|
|
48
|
+
// Create OSS backend builder.
|
|
49
|
+
let mut builder = Oss::default()
|
|
50
|
+
// Set the root for oss, all operations will happen under this root.
|
|
51
|
+
//
|
|
52
|
+
// NOTE: the root must be absolute path.
|
|
53
|
+
.root("/path/to/dir")
|
|
54
|
+
// Set the bucket name, this is required.
|
|
55
|
+
.bucket("test")
|
|
56
|
+
// Set the endpoint.
|
|
57
|
+
//
|
|
58
|
+
// For example:
|
|
59
|
+
// - "https://oss-ap-northeast-1.aliyuncs.com"
|
|
60
|
+
// - "https://oss-hangzhou.aliyuncs.com"
|
|
61
|
+
.endpoint("https://oss-cn-beijing.aliyuncs.com")
|
|
62
|
+
// Set the access_key_id and access_key_secret.
|
|
63
|
+
//
|
|
64
|
+
// OpenDAL will try load credential from the env.
|
|
65
|
+
// If credential not set and no valid credential in env, OpenDAL will
|
|
66
|
+
// send request without signing like anonymous user.
|
|
67
|
+
.access_key_id("access_key_id")
|
|
68
|
+
.access_key_secret("access_key_secret");
|
|
69
|
+
|
|
70
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
71
|
+
|
|
72
|
+
Ok(())
|
|
73
|
+
}
|
|
74
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
## Capabilities
|
|
2
|
+
|
|
3
|
+
This service can be used to:
|
|
4
|
+
|
|
5
|
+
- [x] stat
|
|
6
|
+
- [x] read
|
|
7
|
+
- [x] write
|
|
8
|
+
- [x] create_dir
|
|
9
|
+
- [x] delete
|
|
10
|
+
- [x] copy
|
|
11
|
+
- [x] rename
|
|
12
|
+
- [x] list
|
|
13
|
+
- [ ] presign
|
|
14
|
+
- [ ] blocking
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
- `root`: Set the work directory for backend
|
|
19
|
+
- `endpoint`: Pcloud bucket name
|
|
20
|
+
- `username` Pcloud username
|
|
21
|
+
- `password` Pcloud password
|
|
22
|
+
|
|
23
|
+
You can refer to [`PcloudBuilder`]'s docs for more information
|
|
24
|
+
|
|
25
|
+
## Example
|
|
26
|
+
|
|
27
|
+
### Via Builder
|
|
28
|
+
|
|
29
|
+
```rust,no_run
|
|
30
|
+
use anyhow::Result;
|
|
31
|
+
use opendal::services::Pcloud;
|
|
32
|
+
use opendal::Operator;
|
|
33
|
+
|
|
34
|
+
#[tokio::main]
|
|
35
|
+
async fn main() -> Result<()> {
|
|
36
|
+
// create backend builder
|
|
37
|
+
let mut builder = Pcloud::default()
|
|
38
|
+
// set the storage bucket for OpenDAL
|
|
39
|
+
.root("/")
|
|
40
|
+
// set the bucket for OpenDAL
|
|
41
|
+
.endpoint("[https](https://api.pcloud.com)")
|
|
42
|
+
// set the username for OpenDAL
|
|
43
|
+
.username("opendal@gmail.com")
|
|
44
|
+
// set the password name for OpenDAL
|
|
45
|
+
.password("opendal");
|
|
46
|
+
|
|
47
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
48
|
+
|
|
49
|
+
Ok(())
|
|
50
|
+
}
|
|
51
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
## Capabilities
|
|
2
|
+
|
|
3
|
+
This service can be used to:
|
|
4
|
+
|
|
5
|
+
- [x] stat
|
|
6
|
+
- [x] read
|
|
7
|
+
- [x] write
|
|
8
|
+
- [x] create_dir
|
|
9
|
+
- [x] delete
|
|
10
|
+
- [ ] copy
|
|
11
|
+
- [ ] rename
|
|
12
|
+
- [ ] list
|
|
13
|
+
- [ ] ~~presign~~
|
|
14
|
+
- [x] blocking
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
- `datafile`: Set the path to the persy data file. The directory in the path must already exist.
|
|
19
|
+
- `segment`: Set the name of the persy segment.
|
|
20
|
+
- `index`: Set the name of the persy index.
|
|
21
|
+
|
|
22
|
+
You can refer to [`PersyBuilder`]'s docs for more information
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
### Via Builder
|
|
27
|
+
|
|
28
|
+
```rust,no_run
|
|
29
|
+
use anyhow::Result;
|
|
30
|
+
use opendal::services::Persy;
|
|
31
|
+
use opendal::Operator;
|
|
32
|
+
|
|
33
|
+
#[tokio::main]
|
|
34
|
+
async fn main() -> Result<()> {
|
|
35
|
+
let mut builder = Persy::default()
|
|
36
|
+
.datafile("./test.persy")
|
|
37
|
+
.segment("data")
|
|
38
|
+
.index("index");
|
|
39
|
+
|
|
40
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
41
|
+
Ok(())
|
|
42
|
+
}
|
|
43
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
## Capabilities
|
|
2
|
+
|
|
3
|
+
This service can be used to:
|
|
4
|
+
|
|
5
|
+
- [x] stat
|
|
6
|
+
- [x] read
|
|
7
|
+
- [x] write
|
|
8
|
+
- [x] create_dir
|
|
9
|
+
- [x] delete
|
|
10
|
+
- [ ] copy
|
|
11
|
+
- [ ] rename
|
|
12
|
+
- [ ] ~~list~~
|
|
13
|
+
- [ ] ~~presign~~
|
|
14
|
+
- [ ] blocking
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
- `root`: Set the working directory of `OpenDAL`
|
|
19
|
+
- `connection_string`: Set the connection string of postgres server
|
|
20
|
+
- `table`: Set the table of postgresql
|
|
21
|
+
- `key_field`: Set the key field of postgresql
|
|
22
|
+
- `value_field`: Set the value field of postgresql
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
### Via Builder
|
|
27
|
+
|
|
28
|
+
```rust,no_run
|
|
29
|
+
use anyhow::Result;
|
|
30
|
+
use opendal::services::Postgresql;
|
|
31
|
+
use opendal::Operator;
|
|
32
|
+
|
|
33
|
+
#[tokio::main]
|
|
34
|
+
async fn main() -> Result<()> {
|
|
35
|
+
let mut builder = Postgresql::default()
|
|
36
|
+
.root("/")
|
|
37
|
+
.connection_string("postgresql://you_username:your_password@127.0.0.1:5432/your_database")
|
|
38
|
+
.table("your_table")
|
|
39
|
+
// key field type in the table should be compatible with Rust's &str like text
|
|
40
|
+
.key_field("key")
|
|
41
|
+
// value field type in the table should be compatible with Rust's Vec<u8> like bytea
|
|
42
|
+
.value_field("value");
|
|
43
|
+
|
|
44
|
+
let op = Operator::new(builder)?.finish();
|
|
45
|
+
Ok(())
|
|
46
|
+
}
|
|
47
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
## Capabilities
|
|
2
|
+
|
|
3
|
+
This service can be used to:
|
|
4
|
+
|
|
5
|
+
- [x] stat
|
|
6
|
+
- [x] read
|
|
7
|
+
- [x] write
|
|
8
|
+
- [x] create_dir
|
|
9
|
+
- [x] delete
|
|
10
|
+
- [x] copy
|
|
11
|
+
- [x] rename
|
|
12
|
+
- [ ] ~~list~~
|
|
13
|
+
- [ ] ~~presign~~
|
|
14
|
+
- [x] blocking
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
- `datadir`: Set the path to the redb data directory.
|
|
19
|
+
- `table`: Set the table name for Redb.
|
|
20
|
+
|
|
21
|
+
You can refer to [`RedbBuilder`]'s docs for more information.
|
|
22
|
+
|
|
23
|
+
## Example
|
|
24
|
+
|
|
25
|
+
### Via Builder
|
|
26
|
+
|
|
27
|
+
```rust,no_run
|
|
28
|
+
use anyhow::Result;
|
|
29
|
+
use opendal::services::Redb;
|
|
30
|
+
use opendal::Operator;
|
|
31
|
+
|
|
32
|
+
#[tokio::main]
|
|
33
|
+
async fn main() -> Result<()> {
|
|
34
|
+
let mut builder = Redb::default()
|
|
35
|
+
.datadir("/tmp/opendal/redb")
|
|
36
|
+
.table("opendal-redb");
|
|
37
|
+
|
|
38
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
39
|
+
Ok(())
|
|
40
|
+
}
|
|
41
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
## Capabilities
|
|
2
|
+
|
|
3
|
+
This service can be used to:
|
|
4
|
+
|
|
5
|
+
- [x] stat
|
|
6
|
+
- [x] read
|
|
7
|
+
- [x] write
|
|
8
|
+
- [x] delete
|
|
9
|
+
- [ ] ~~create_dir~~
|
|
10
|
+
- [ ] ~~copy~~
|
|
11
|
+
- [ ] ~~rename~~
|
|
12
|
+
- [ ] ~~list~~
|
|
13
|
+
- [ ] ~~presign~~
|
|
14
|
+
|
|
15
|
+
## Configuration
|
|
16
|
+
|
|
17
|
+
- `root`: Set the working directory of `OpenDAL`
|
|
18
|
+
- `endpoint`: Set the network address of redis server
|
|
19
|
+
- `cluster_endpoints`: Set the network address of redis cluster server. This parameter is mutually exclusive with the `endpoint` parameter.
|
|
20
|
+
- `username`: Set the username of Redis
|
|
21
|
+
- `password`: Set the password for authentication
|
|
22
|
+
- `db`: Set the DB of redis
|
|
23
|
+
|
|
24
|
+
You can refer to [`RedisBuilder`]'s docs for more information
|
|
25
|
+
|
|
26
|
+
## Example
|
|
27
|
+
|
|
28
|
+
### Via Builder
|
|
29
|
+
|
|
30
|
+
```rust,no_run
|
|
31
|
+
use anyhow::Result;
|
|
32
|
+
use opendal::services::Redis;
|
|
33
|
+
use opendal::Operator;
|
|
34
|
+
|
|
35
|
+
#[tokio::main]
|
|
36
|
+
async fn main() -> Result<()> {
|
|
37
|
+
let mut builder = Redis::default();
|
|
38
|
+
|
|
39
|
+
// this will build a Operator accessing Redis which runs on tcp://localhost:6379
|
|
40
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
41
|
+
Ok(())
|
|
42
|
+
}
|
|
43
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
## Capabilities
|
|
2
|
+
|
|
3
|
+
This service can be used to:
|
|
4
|
+
|
|
5
|
+
- [x] stat
|
|
6
|
+
- [x] read
|
|
7
|
+
- [x] write
|
|
8
|
+
- [x] create_dir
|
|
9
|
+
- [x] delete
|
|
10
|
+
- [x] copy
|
|
11
|
+
- [x] rename
|
|
12
|
+
- [ ] ~~list~~
|
|
13
|
+
- [ ] ~~presign~~
|
|
14
|
+
- [x] blocking
|
|
15
|
+
|
|
16
|
+
## Note
|
|
17
|
+
|
|
18
|
+
OpenDAL will build rocksdb from source by default.
|
|
19
|
+
|
|
20
|
+
To link with existing rocksdb lib, please set one of the following:
|
|
21
|
+
|
|
22
|
+
- `ROCKSDB_LIB_DIR` to the dir that contains `librocksdb.so`
|
|
23
|
+
- `ROCKSDB_STATIC` to the dir that contains `librocksdb.a`
|
|
24
|
+
|
|
25
|
+
If the version of RocksDB is below 6.0, you may encounter compatibility
|
|
26
|
+
issues. It is advisable to follow the steps provided in the [`INSTALL`](https://github.com/facebook/rocksdb/blob/main/INSTALL.md)
|
|
27
|
+
file to build rocksdb, rather than relying on system libraries that
|
|
28
|
+
may be outdated and incompatible.
|
|
29
|
+
|
|
30
|
+
## Configuration
|
|
31
|
+
|
|
32
|
+
- `root`: Set the working directory of `OpenDAL`
|
|
33
|
+
- `datadir`: Set the path to the rocksdb data directory
|
|
34
|
+
|
|
35
|
+
You can refer to [`RocksdbBuilder`]'s docs for more information.
|
|
36
|
+
|
|
37
|
+
## Example
|
|
38
|
+
|
|
39
|
+
### Via Builder
|
|
40
|
+
|
|
41
|
+
```rust,no_run
|
|
42
|
+
use anyhow::Result;
|
|
43
|
+
use opendal::services::Rocksdb;
|
|
44
|
+
use opendal::Operator;
|
|
45
|
+
|
|
46
|
+
#[tokio::main]
|
|
47
|
+
async fn main() -> Result<()> {
|
|
48
|
+
let mut builder = Rocksdb::default()
|
|
49
|
+
.datadir("/tmp/opendal/rocksdb");
|
|
50
|
+
|
|
51
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
52
|
+
Ok(())
|
|
53
|
+
}
|
|
54
|
+
```
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
|
|
2
|
+
## Compatible Services
|
|
3
|
+
|
|
4
|
+
### AWS S3
|
|
5
|
+
|
|
6
|
+
[AWS S3](https://aws.amazon.com/s3/) is the default implementations of s3 services. Only `bucket` is required.
|
|
7
|
+
|
|
8
|
+
```rust,ignore
|
|
9
|
+
builder.bucket("<bucket_name>");
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Alibaba Object Storage Service (OSS)
|
|
13
|
+
|
|
14
|
+
[OSS](https://www.alibabacloud.com/product/object-storage-service) is a s3 compatible service provided by [Alibaba Cloud](https://www.alibabacloud.com).
|
|
15
|
+
|
|
16
|
+
To connect to OSS, we need to set:
|
|
17
|
+
|
|
18
|
+
- `endpoint`: The endpoint of oss, for example: `https://oss-cn-hangzhou.aliyuncs.com`
|
|
19
|
+
- `bucket`: The bucket name of oss.
|
|
20
|
+
|
|
21
|
+
> OSS provide internal endpoint for used at alibabacloud internally, please visit [OSS Regions and endpoints](https://www.alibabacloud.com/help/en/object-storage-service/latest/regions-and-endpoints) for more details.
|
|
22
|
+
|
|
23
|
+
> OSS only supports the virtual host style, users could meet errors like:
|
|
24
|
+
>
|
|
25
|
+
> ```xml
|
|
26
|
+
> <?xml version="1.0" encoding="UTF-8"?>
|
|
27
|
+
> <Error>
|
|
28
|
+
> <Code>SecondLevelDomainForbidden</Code>
|
|
29
|
+
> <Message>The bucket you are attempting to access must be addressed using OSS third level domain.</Message>
|
|
30
|
+
> <RequestId>62A1C265292C0632377F021F</RequestId>
|
|
31
|
+
> <HostId>oss-cn-hangzhou.aliyuncs.com</HostId>
|
|
32
|
+
> </Error>
|
|
33
|
+
> ```
|
|
34
|
+
>
|
|
35
|
+
> In that case, please enable virtual host style for requesting.
|
|
36
|
+
|
|
37
|
+
```rust,ignore
|
|
38
|
+
builder.endpoint("https://oss-cn-hangzhou.aliyuncs.com");
|
|
39
|
+
builder.region("<region>");
|
|
40
|
+
builder.bucket("<bucket_name>");
|
|
41
|
+
builder.enable_virtual_host_style();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Minio
|
|
45
|
+
|
|
46
|
+
[minio](https://min.io/) is an open-source s3 compatible services.
|
|
47
|
+
|
|
48
|
+
To connect to minio, we need to set:
|
|
49
|
+
|
|
50
|
+
- `endpoint`: The endpoint of minio, for example: `http://127.0.0.1:9000`
|
|
51
|
+
- `region`: The region of minio. If you don't care about it, just set it to "auto", it will be ignored.
|
|
52
|
+
- `bucket`: The bucket name of minio.
|
|
53
|
+
|
|
54
|
+
```rust,ignore
|
|
55
|
+
builder.endpoint("http://127.0.0.1:9000");
|
|
56
|
+
builder.region("<region>");
|
|
57
|
+
builder.bucket("<bucket_name>");
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### QingStor Object Storage
|
|
61
|
+
|
|
62
|
+
[QingStor Object Storage](https://www.qingcloud.com/products/qingstor) is a S3-compatible service provided by [QingCloud](https://www.qingcloud.com/).
|
|
63
|
+
|
|
64
|
+
To connect to QingStor Object Storage, we need to set:
|
|
65
|
+
|
|
66
|
+
- `endpoint`: The endpoint of QingStor s3 compatible endpoint, for example: `https://s3.pek3b.qingstor.com`
|
|
67
|
+
- `bucket`: The bucket name.
|
|
68
|
+
|
|
69
|
+
### Scaleway Object Storage
|
|
70
|
+
|
|
71
|
+
[Scaleway Object Storage](https://www.scaleway.com/en/object-storage/) is a S3-compatible and multi-AZ redundant object storage service.
|
|
72
|
+
|
|
73
|
+
To connect to Scaleway Object Storage, we need to set:
|
|
74
|
+
|
|
75
|
+
- `endpoint`: The endpoint of scaleway, for example: `https://s3.nl-ams.scw.cloud`
|
|
76
|
+
- `region`: The region of scaleway.
|
|
77
|
+
- `bucket`: The bucket name of scaleway.
|
|
78
|
+
|
|
79
|
+
### Tencent Cloud Object Storage (COS)
|
|
80
|
+
|
|
81
|
+
[COS](https://intl.cloud.tencent.com/products/cos) is a s3 compatible service provided by [Tencent Cloud](https://intl.cloud.tencent.com/).
|
|
82
|
+
|
|
83
|
+
To connect to COS, we need to set:
|
|
84
|
+
|
|
85
|
+
- `endpoint`: The endpoint of cos, for example: `https://cos.ap-beijing.myqcloud.com`
|
|
86
|
+
- `bucket`: The bucket name of cos.
|
|
87
|
+
|
|
88
|
+
### Wasabi Object Storage
|
|
89
|
+
|
|
90
|
+
[Wasabi](https://wasabi.com/) is a s3 compatible service.
|
|
91
|
+
|
|
92
|
+
> Cloud storage pricing that is 80% less than Amazon S3.
|
|
93
|
+
|
|
94
|
+
To connect to wasabi, we need to set:
|
|
95
|
+
|
|
96
|
+
- `endpoint`: The endpoint of wasabi, for example: `https://s3.us-east-2.wasabisys.com`
|
|
97
|
+
- `bucket`: The bucket name of wasabi.
|
|
98
|
+
|
|
99
|
+
> Refer to [What are the service URLs for Wasabi's different storage regions?](https://wasabi-support.zendesk.com/hc/en-us/articles/360015106031) for more details.
|
|
100
|
+
|
|
101
|
+
### Cloudflare R2
|
|
102
|
+
|
|
103
|
+
[Cloudflare R2](https://developers.cloudflare.com/r2/) provides s3 compatible API.
|
|
104
|
+
|
|
105
|
+
> Cloudflare R2 Storage allows developers to store large amounts of unstructured data without the costly egress bandwidth fees associated with typical cloud storage services.
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
To connect to r2, we need to set:
|
|
109
|
+
|
|
110
|
+
- `endpoint`: The endpoint of r2, for example: `https://<account_id>.r2.cloudflarestorage.com`
|
|
111
|
+
- `bucket`: The bucket name of r2.
|
|
112
|
+
- `region`: When you create a new bucket, the data location is set to Automatic by default. So please use `auto` for region.
|
|
113
|
+
- `batch_max_operations`: R2's delete objects will return `Internal Error` if the batch is larger than `700`. Please set this value `<= 700` to make sure batch delete work as expected.
|
|
114
|
+
- `enable_exact_buf_write`: R2 requires the non-tailing parts size to be exactly the same. Please enable this option to avoid the error `All non-trailing parts must have the same length`.
|
|
115
|
+
|
|
116
|
+
### Google Cloud Storage XML API
|
|
117
|
+
[Google Cloud Storage XML API](https://cloud.google.com/storage/docs/xml-api/overview) provides s3 compatible API.
|
|
118
|
+
- `endpoint`: The endpoint of Google Cloud Storage XML API, for example: `https://storage.googleapis.com`
|
|
119
|
+
- `bucket`: The bucket name.
|
|
120
|
+
- To access GCS via S3 API, please enable `features = ["native-tls"]` in your `Cargo.toml` to avoid connection being reset when using `rustls`. Tracking in <https://github.com/seanmonstar/reqwest/issues/1809>
|
|
121
|
+
|
|
122
|
+
### Ceph Rados Gateway
|
|
123
|
+
Ceph supports a RESTful API that is compatible with the basic data access model of the Amazon S3 API.
|
|
124
|
+
|
|
125
|
+
For more information, refer: <https://docs.ceph.com/en/latest/radosgw/s3/>
|
|
126
|
+
|