opendal 0.1.6.pre.rc.1-arm64-darwin-23
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.bundle +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,61 @@
|
|
|
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 dir for backend.
|
|
19
|
+
- `access_token`: Set the access_token for backend.
|
|
20
|
+
- `client_id`: Set the client_id for backend.
|
|
21
|
+
- `client_secret`: Set the client_secret for backend.
|
|
22
|
+
- `refresh_token`: Set the refresh_token for backend.
|
|
23
|
+
- `drive_type`: Set the drive_type for backend.
|
|
24
|
+
|
|
25
|
+
Refer to [`AliyunDriveBuilder`]`s public API docs for more information.
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
|
|
29
|
+
### Basic Setup
|
|
30
|
+
|
|
31
|
+
```rust,no_run
|
|
32
|
+
use std::sync::Arc;
|
|
33
|
+
|
|
34
|
+
use anyhow::Result;
|
|
35
|
+
use opendal::services::AliyunDrive;
|
|
36
|
+
use opendal::Operator;
|
|
37
|
+
|
|
38
|
+
#[tokio::main]
|
|
39
|
+
async fn main() -> Result<()> {
|
|
40
|
+
// Create aliyun-drive backend builder.
|
|
41
|
+
let mut builder = AliyunDrive::default()
|
|
42
|
+
// Set the root for aliyun-drive, all operations will happen under this root.
|
|
43
|
+
//
|
|
44
|
+
// NOTE: the root must be absolute path.
|
|
45
|
+
.root("/path/to/dir")
|
|
46
|
+
// Set the client_id. This is required.
|
|
47
|
+
.client_id("client_id")
|
|
48
|
+
// Set the client_secret. This is required.
|
|
49
|
+
.client_secret("client_secret")
|
|
50
|
+
// Set the refresh_token. This is required.
|
|
51
|
+
.refresh_token("refresh_token")
|
|
52
|
+
// Set the drive_type. This is required.
|
|
53
|
+
//
|
|
54
|
+
// Fallback to the default type if no other types found.
|
|
55
|
+
.drive_type("resource");
|
|
56
|
+
|
|
57
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
58
|
+
|
|
59
|
+
Ok(())
|
|
60
|
+
}
|
|
61
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
- [x] rename
|
|
12
|
+
- [x] list
|
|
13
|
+
- [ ] presign
|
|
14
|
+
- [ ] blocking
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
- `root`: Set the work directory for backend
|
|
19
|
+
- `endpoint`: Customizable endpoint setting
|
|
20
|
+
|
|
21
|
+
You can refer to [`AlluxioBuilder`]'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::Alluxio;
|
|
30
|
+
use opendal::Operator;
|
|
31
|
+
|
|
32
|
+
#[tokio::main]
|
|
33
|
+
async fn main() -> Result<()> {
|
|
34
|
+
// create backend builder
|
|
35
|
+
let mut builder = Alluxio::default()
|
|
36
|
+
// set the storage bucket for OpenDAL
|
|
37
|
+
.root("/")
|
|
38
|
+
// set the endpoint for OpenDAL
|
|
39
|
+
.endpoint("http://127.0.0.1:39999");
|
|
40
|
+
|
|
41
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
42
|
+
|
|
43
|
+
Ok(())
|
|
44
|
+
}
|
|
45
|
+
```
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
## Capabilities
|
|
2
|
+
|
|
3
|
+
This service can be used to:
|
|
4
|
+
|
|
5
|
+
- [x] stat
|
|
6
|
+
- [x] read
|
|
7
|
+
- [x] write
|
|
8
|
+
- [x] append
|
|
9
|
+
- [x] create_dir
|
|
10
|
+
- [x] delete
|
|
11
|
+
- [x] copy
|
|
12
|
+
- [ ] rename
|
|
13
|
+
- [x] list
|
|
14
|
+
- [x] presign
|
|
15
|
+
- [ ] blocking
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
- `root`: Set the work dir for backend.
|
|
20
|
+
- `container`: Set the container name for backend.
|
|
21
|
+
- `endpoint`: Set the endpoint for backend.
|
|
22
|
+
- `account_name`: Set the account_name for backend.
|
|
23
|
+
- `account_key`: Set the account_key for backend.
|
|
24
|
+
|
|
25
|
+
Refer to public API docs for more information.
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
This example works on [Azurite](https://github.com/Azure/Azurite) for local developments.
|
|
30
|
+
|
|
31
|
+
### Start local blob service
|
|
32
|
+
|
|
33
|
+
```shell
|
|
34
|
+
docker run -p 10000:10000 mcr.microsoft.com/azure-storage/azurite
|
|
35
|
+
az storage container create --name test --connection-string "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Init OpenDAL Operator
|
|
39
|
+
|
|
40
|
+
### Via Builder
|
|
41
|
+
|
|
42
|
+
```rust,no_run
|
|
43
|
+
use std::sync::Arc;
|
|
44
|
+
|
|
45
|
+
use anyhow::Result;
|
|
46
|
+
use opendal::services::Azblob;
|
|
47
|
+
use opendal::Operator;
|
|
48
|
+
|
|
49
|
+
#[tokio::main]
|
|
50
|
+
async fn main() -> Result<()> {
|
|
51
|
+
// Create azblob backend builder.
|
|
52
|
+
let mut builder = Azblob::default()
|
|
53
|
+
// Set the root for azblob, all operations will happen under this root.
|
|
54
|
+
//
|
|
55
|
+
// NOTE: the root must be absolute path.
|
|
56
|
+
.root("/path/to/dir")
|
|
57
|
+
// Set the container name, this is required.
|
|
58
|
+
.container("test")
|
|
59
|
+
// Set the endpoint, this is required.
|
|
60
|
+
//
|
|
61
|
+
// For examples:
|
|
62
|
+
// - "http://127.0.0.1:10000/devstoreaccount1"
|
|
63
|
+
// - "https://accountname.blob.core.windows.net"
|
|
64
|
+
.endpoint("http://127.0.0.1:10000/devstoreaccount1")
|
|
65
|
+
// Set the account_name and account_key.
|
|
66
|
+
//
|
|
67
|
+
// OpenDAL will try load credential from the env.
|
|
68
|
+
// If credential not set and no valid credential in env, OpenDAL will
|
|
69
|
+
// send request without signing like anonymous user.
|
|
70
|
+
.account_name("devstoreaccount1")
|
|
71
|
+
.account_key("Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==");
|
|
72
|
+
|
|
73
|
+
// `Accessor` provides the low level APIs, we will use `Operator` normally.
|
|
74
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
75
|
+
Ok(())
|
|
76
|
+
}
|
|
77
|
+
```
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
As known as `abfs`, `azdls` or `azdls`.
|
|
2
|
+
|
|
3
|
+
This service will visit the [ABFS](https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-abfs-driver) URI supported by [Azure Data Lake Storage Gen2](https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction).
|
|
4
|
+
|
|
5
|
+
## Notes
|
|
6
|
+
|
|
7
|
+
`azdls` is different from `azfile` service which used to visit [Azure File Storage](https://azure.microsoft.com/en-us/services/storage/files/).
|
|
8
|
+
|
|
9
|
+
## Capabilities
|
|
10
|
+
|
|
11
|
+
This service can be used to:
|
|
12
|
+
|
|
13
|
+
- [x] stat
|
|
14
|
+
- [x] read
|
|
15
|
+
- [x] write
|
|
16
|
+
- [x] create_dir
|
|
17
|
+
- [x] delete
|
|
18
|
+
- [ ] copy
|
|
19
|
+
- [x] rename
|
|
20
|
+
- [x] list
|
|
21
|
+
- [ ] presign
|
|
22
|
+
- [ ] blocking
|
|
23
|
+
|
|
24
|
+
## Configuration
|
|
25
|
+
|
|
26
|
+
- `root`: Set the work dir for backend.
|
|
27
|
+
- `filesystem`: Set the filesystem name for backend.
|
|
28
|
+
- `endpoint`: Set the endpoint for backend.
|
|
29
|
+
- `account_name`: Set the account_name for backend.
|
|
30
|
+
- `account_key`: Set the account_key for backend.
|
|
31
|
+
|
|
32
|
+
Refer to public API docs for more information.
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
|
|
36
|
+
### Via Builder
|
|
37
|
+
|
|
38
|
+
```rust,no_run
|
|
39
|
+
use std::sync::Arc;
|
|
40
|
+
|
|
41
|
+
use anyhow::Result;
|
|
42
|
+
use opendal::services::Azdls;
|
|
43
|
+
use opendal::Operator;
|
|
44
|
+
|
|
45
|
+
#[tokio::main]
|
|
46
|
+
async fn main() -> Result<()> {
|
|
47
|
+
// Create azdls backend builder.
|
|
48
|
+
let mut builder = Azdls::default()
|
|
49
|
+
// Set the root for azdls, all operations will happen under this root.
|
|
50
|
+
//
|
|
51
|
+
// NOTE: the root must be absolute path.
|
|
52
|
+
.root("/path/to/dir")
|
|
53
|
+
// Set the filesystem name, this is required.
|
|
54
|
+
.filesystem("test")
|
|
55
|
+
// Set the endpoint, this is required.
|
|
56
|
+
//
|
|
57
|
+
// For examples:
|
|
58
|
+
// - "https://accountname.dfs.core.windows.net"
|
|
59
|
+
.endpoint("https://accountname.dfs.core.windows.net")
|
|
60
|
+
// Set the account_name and account_key.
|
|
61
|
+
//
|
|
62
|
+
// OpenDAL will try load credential from the env.
|
|
63
|
+
// If credential not set and no valid credential in env, OpenDAL will
|
|
64
|
+
// send request without signing like anonymous user.
|
|
65
|
+
.account_name("account_name")
|
|
66
|
+
.account_key("account_key");
|
|
67
|
+
|
|
68
|
+
// `Accessor` provides the low level APIs, we will use `Operator` normally.
|
|
69
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
70
|
+
|
|
71
|
+
Ok(())
|
|
72
|
+
}
|
|
73
|
+
```
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
- [x] rename
|
|
12
|
+
- [x] list
|
|
13
|
+
- [ ] presign
|
|
14
|
+
- [ ] blocking
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
- `root`: Set the work dir for backend.
|
|
19
|
+
- `endpoint`: Set the endpoint for backend.
|
|
20
|
+
- `account_name`: Set the account_name for backend.
|
|
21
|
+
- `account_key`: Set the account_key for backend.
|
|
22
|
+
- `share_name`: Set the share_name for backend.
|
|
23
|
+
|
|
24
|
+
Refer to public API docs for more information.
|
|
25
|
+
|
|
26
|
+
## Example
|
|
27
|
+
|
|
28
|
+
### Via Builder
|
|
29
|
+
|
|
30
|
+
```rust,no_run
|
|
31
|
+
use std::sync::Arc;
|
|
32
|
+
|
|
33
|
+
use anyhow::Result;
|
|
34
|
+
use opendal::services::Azfile;
|
|
35
|
+
use opendal::Operator;
|
|
36
|
+
|
|
37
|
+
#[tokio::main]
|
|
38
|
+
async fn main() -> Result<()> {
|
|
39
|
+
// Create azfile backend builder.
|
|
40
|
+
let mut builder = Azfile::default()
|
|
41
|
+
// Set the root for azfile, all operations will happen under this root.
|
|
42
|
+
//
|
|
43
|
+
// NOTE: the root must be absolute path.
|
|
44
|
+
.root("/path/to/dir")
|
|
45
|
+
// Set the filesystem name, this is required.
|
|
46
|
+
.share_name("test")
|
|
47
|
+
// Set the endpoint, this is required.
|
|
48
|
+
//
|
|
49
|
+
// For examples:
|
|
50
|
+
// - "https://accountname.file.core.windows.net"
|
|
51
|
+
.endpoint("https://accountname.file.core.windows.net")
|
|
52
|
+
// Set the account_name and account_key.
|
|
53
|
+
//
|
|
54
|
+
// OpenDAL will try load credential from the env.
|
|
55
|
+
// If credential not set and no valid credential in env, OpenDAL will
|
|
56
|
+
// send request without signing like anonymous user.
|
|
57
|
+
.account_name("account_name")
|
|
58
|
+
.account_key("account_key");
|
|
59
|
+
|
|
60
|
+
// `Accessor` provides the low level APIs, we will use `Operator` normally.
|
|
61
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
62
|
+
|
|
63
|
+
Ok(())
|
|
64
|
+
}
|
|
65
|
+
```
|
|
@@ -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
|
+
- [ ] rename
|
|
12
|
+
- [x] list
|
|
13
|
+
- [x] presign
|
|
14
|
+
- [ ] blocking
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
- `root`: Set the work directory for backend
|
|
19
|
+
- `key_id`: B2 application key keyID
|
|
20
|
+
- `application_key` B2 application key applicationKey
|
|
21
|
+
- `bucket` B2 bucket name
|
|
22
|
+
- `bucket_id` B2 bucket_id
|
|
23
|
+
|
|
24
|
+
You can refer to [`B2Builder`]'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::B2;
|
|
33
|
+
use opendal::Operator;
|
|
34
|
+
|
|
35
|
+
#[tokio::main]
|
|
36
|
+
async fn main() -> Result<()> {
|
|
37
|
+
// create backend builder
|
|
38
|
+
let mut builder = B2::default()
|
|
39
|
+
// set the storage bucket for OpenDAL
|
|
40
|
+
.root("/")
|
|
41
|
+
// set the key_id for OpenDAL
|
|
42
|
+
.application_key_id("xxxxxxxxxx")
|
|
43
|
+
// set the key_id for OpenDAL
|
|
44
|
+
.application_key("xxxxxxxxxx")
|
|
45
|
+
// set the bucket name for OpenDAL
|
|
46
|
+
.bucket("opendal")
|
|
47
|
+
// set the bucket_id for OpenDAL
|
|
48
|
+
.bucket_id("xxxxxxxxxxxxx");
|
|
49
|
+
|
|
50
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
51
|
+
|
|
52
|
+
Ok(())
|
|
53
|
+
}
|
|
54
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
- `datadir`: Set the path to the cacache data directory
|
|
19
|
+
|
|
20
|
+
You can refer to [`CacacheBuilder`]'s docs for more information
|
|
21
|
+
|
|
22
|
+
## Example
|
|
23
|
+
|
|
24
|
+
### Via Builder
|
|
25
|
+
|
|
26
|
+
```rust,no_run
|
|
27
|
+
use anyhow::Result;
|
|
28
|
+
use opendal::services::Cacache;
|
|
29
|
+
use opendal::Operator;
|
|
30
|
+
|
|
31
|
+
#[tokio::main]
|
|
32
|
+
async fn main() -> Result<()> {
|
|
33
|
+
let mut builder = Cacache::default().datadir("/tmp/opendal/cacache");
|
|
34
|
+
|
|
35
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
36
|
+
Ok(())
|
|
37
|
+
}
|
|
38
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
- [x] list
|
|
13
|
+
- [ ] ~~presign~~
|
|
14
|
+
- [ ] blocking
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
- `root`: Set the working directory of `OpenDAL`
|
|
19
|
+
- `api_token`: Set the token of cloudflare api
|
|
20
|
+
- `account_id`: Set the account identifier of cloudflare
|
|
21
|
+
- `namespace_id`: Set the namespace identifier of d1
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
- [ ] rename
|
|
12
|
+
- [x] list
|
|
13
|
+
- [ ] presign
|
|
14
|
+
- [ ] blocking
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
- `root`: Set the work directory for backend
|
|
19
|
+
- `bucket`: Set the container name for backend
|
|
20
|
+
- `endpoint`: Customizable endpoint setting
|
|
21
|
+
- `access_key_id`: Set the access_key_id for backend.
|
|
22
|
+
- `secret_access_key`: Set the secret_access_key for backend.
|
|
23
|
+
|
|
24
|
+
You can refer to [`CosBuilder`]'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::Cos;
|
|
33
|
+
use opendal::Operator;
|
|
34
|
+
|
|
35
|
+
#[tokio::main]
|
|
36
|
+
async fn main() -> Result<()> {
|
|
37
|
+
// create backend builder
|
|
38
|
+
let mut builder = Cos::default()
|
|
39
|
+
// set the storage bucket for OpenDAL
|
|
40
|
+
.bucket("test")
|
|
41
|
+
// set the endpoint for OpenDAL
|
|
42
|
+
.endpoint("https://cos.ap-singapore.myqcloud.com")
|
|
43
|
+
// Set the access_key_id and secret_access_key.
|
|
44
|
+
//
|
|
45
|
+
// OpenDAL will try load credential from the env.
|
|
46
|
+
// If credential not set and no valid credential in env, OpenDAL will
|
|
47
|
+
// send request without signing like anonymous user.
|
|
48
|
+
.secret_id("secret_id")
|
|
49
|
+
.secret_key("secret_access_key");
|
|
50
|
+
|
|
51
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
52
|
+
|
|
53
|
+
Ok(())
|
|
54
|
+
}
|
|
55
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
- `token`: Set the token of cloudflare api
|
|
20
|
+
- `account_id`: Set the account id of cloudflare api
|
|
21
|
+
- `database_id`: Set the database id of cloudflare api
|
|
22
|
+
- `table`: Set the table of D1 Database
|
|
23
|
+
- `key_field`: Set the key field of D1 Database
|
|
24
|
+
- `value_field`: Set the value field of D1 Database
|
|
25
|
+
|
|
26
|
+
## Example
|
|
27
|
+
|
|
28
|
+
### Via Builder
|
|
29
|
+
|
|
30
|
+
```rust,no_run
|
|
31
|
+
use anyhow::Result;
|
|
32
|
+
use opendal::services::D1;
|
|
33
|
+
use opendal::Operator;
|
|
34
|
+
|
|
35
|
+
#[tokio::main]
|
|
36
|
+
async fn main() -> Result<()> {
|
|
37
|
+
let mut builder = D1::default()
|
|
38
|
+
.token("token")
|
|
39
|
+
.account_id("account_id")
|
|
40
|
+
.database_id("database_id")
|
|
41
|
+
.table("table")
|
|
42
|
+
.key_field("key_field")
|
|
43
|
+
.value_field("value_field");
|
|
44
|
+
|
|
45
|
+
let op = Operator::new(builder)?.finish();
|
|
46
|
+
Ok(())
|
|
47
|
+
}
|
|
48
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
|
|
15
|
+
## Configuration
|
|
16
|
+
|
|
17
|
+
- `root`: Set the root path for this dashmap instance.
|
|
18
|
+
|
|
19
|
+
You can refer to [`DashmapBuilder`]'s docs for more information
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
|
|
23
|
+
### Via Builder
|
|
24
|
+
|
|
25
|
+
```rust,no_run
|
|
26
|
+
use anyhow::Result;
|
|
27
|
+
use opendal::services::Dashmap;
|
|
28
|
+
use opendal::Operator;
|
|
29
|
+
|
|
30
|
+
#[tokio::main]
|
|
31
|
+
async fn main() -> Result<()> {
|
|
32
|
+
let mut builder = Dashmap::default()
|
|
33
|
+
.root("/");
|
|
34
|
+
|
|
35
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
36
|
+
Ok(())
|
|
37
|
+
}
|
|
38
|
+
```
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
This service will visit the [DBFS API](https://docs.databricks.com/api/azure/workspace/dbfs) supported by [Databricks File System](https://docs.databricks.com/en/dbfs/index.html).
|
|
2
|
+
|
|
3
|
+
## Capabilities
|
|
4
|
+
|
|
5
|
+
This service can be used to:
|
|
6
|
+
|
|
7
|
+
- [x] stat
|
|
8
|
+
- [x] read
|
|
9
|
+
- [x] write
|
|
10
|
+
- [x] create_dir
|
|
11
|
+
- [x] delete
|
|
12
|
+
- [ ] copy
|
|
13
|
+
- [x] rename
|
|
14
|
+
- [x] list
|
|
15
|
+
- [ ] ~~presign~~
|
|
16
|
+
- [ ] blocking
|
|
17
|
+
|
|
18
|
+
## Configurations
|
|
19
|
+
|
|
20
|
+
- `root`: Set the work directory for backend.
|
|
21
|
+
- `endpoint`: Set the endpoint for backend.
|
|
22
|
+
- `token`: Databricks personal access token.
|
|
23
|
+
|
|
24
|
+
Refer to [`DbfsBuilder`]'s public API docs for more information.
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
### Via Builder
|
|
29
|
+
|
|
30
|
+
```rust,no_run
|
|
31
|
+
use std::sync::Arc;
|
|
32
|
+
|
|
33
|
+
use anyhow::Result;
|
|
34
|
+
use opendal::services::Dbfs;
|
|
35
|
+
use opendal::Operator;
|
|
36
|
+
|
|
37
|
+
#[tokio::main]
|
|
38
|
+
async fn main() -> Result<()> {
|
|
39
|
+
let mut builder = Dbfs::default()
|
|
40
|
+
// set the root for Dbfs, all operations will happen under this root
|
|
41
|
+
//
|
|
42
|
+
// Note:
|
|
43
|
+
// if the root is not exists, the builder will automatically create the
|
|
44
|
+
// root directory for you
|
|
45
|
+
// if the root exists and is a directory, the builder will continue working
|
|
46
|
+
// if the root exists and is a folder, the builder will fail on building backend
|
|
47
|
+
.root("/path/to/dir")
|
|
48
|
+
// set the endpoint of Dbfs workspace
|
|
49
|
+
.endpoint("https://adb-1234567890123456.78.azuredatabricks.net")
|
|
50
|
+
// set the personal access token for builder
|
|
51
|
+
.token("access_token");
|
|
52
|
+
|
|
53
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
54
|
+
|
|
55
|
+
Ok(())
|
|
56
|
+
}
|
|
57
|
+
```
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
- [x] batch
|
|
14
|
+
- [ ] blocking
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
- `root`: Set the work directory for this backend.
|
|
19
|
+
|
|
20
|
+
### Credentials related
|
|
21
|
+
|
|
22
|
+
#### Just provide Access Token (Temporary)
|
|
23
|
+
|
|
24
|
+
- `access_token`: set the access_token for this backend.
|
|
25
|
+
Please notice its expiration.
|
|
26
|
+
|
|
27
|
+
#### Or provide Client ID and Client Secret and refresh token (Long Term)
|
|
28
|
+
|
|
29
|
+
If you want to let OpenDAL to refresh the access token automatically,
|
|
30
|
+
please provide the following fields:
|
|
31
|
+
|
|
32
|
+
- `refresh_token`: set the refresh_token for dropbox api
|
|
33
|
+
- `client_id`: set the client_id for dropbox api
|
|
34
|
+
- `client_secret`: set the client_secret for dropbox api
|
|
35
|
+
|
|
36
|
+
OpenDAL is a library, it cannot do the first step of OAuth2 for you.
|
|
37
|
+
You need to get authorization code from user by calling Dropbox's authorize url
|
|
38
|
+
and exchange it for refresh token.
|
|
39
|
+
|
|
40
|
+
Please refer to [Dropbox OAuth2 Guide](https://www.dropbox.com/developers/reference/oauth-guide)
|
|
41
|
+
for more information.
|
|
42
|
+
|
|
43
|
+
You can refer to [`DropboxBuilder`]'s docs for more information
|
|
44
|
+
|
|
45
|
+
## Example
|
|
46
|
+
|
|
47
|
+
### Via Builder
|
|
48
|
+
|
|
49
|
+
```rust,no_run
|
|
50
|
+
use anyhow::Result;
|
|
51
|
+
use opendal::raw::OpWrite;
|
|
52
|
+
use opendal::services::Dropbox;
|
|
53
|
+
use opendal::Operator;
|
|
54
|
+
|
|
55
|
+
#[tokio::main]
|
|
56
|
+
async fn main() -> Result<()> {
|
|
57
|
+
let mut builder = Dropbox::default()
|
|
58
|
+
.root("/opendal")
|
|
59
|
+
.access_token("<token>");
|
|
60
|
+
|
|
61
|
+
let op: Operator = Operator::new(builder)?.finish();
|
|
62
|
+
Ok(())
|
|
63
|
+
}
|
|
64
|
+
```
|