Bump to version 0.11.0 (#435)
* Bump to version 0.11.0
Signed-off-by: Xuanwo <github@xuanwo.io>
* Add presign in index
Signed-off-by: Xuanwo <github@xuanwo.io>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3d319f2..8933e9d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,22 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/)
and this project adheres to [Semantic Versioning](https://semver.org/).
+## [v0.11.0] - 2022-07-11
+
+### Added
+
+- feat: derive Deserialize/Serialize for ObjectMetaData (#420)
+- RFC-0423: Command Line Interface (#423)
+- feat: optimize range read (#425)
+- feat(oli): Add basic layout for oli (#426)
+- RFC-0429: Init From Iter (#429)
+- feat: Implement RFC-0429 Init From Iter (#432)
+- feat(oli): Add cp command layout (#428)
+
+### Docs
+
+- docs: Update description of OpenDAL (#434)
+
## [v0.10.0] - 2022-07-04
### Added
@@ -459,6 +475,7 @@
Hello, OpenDAL!
+[v0.11.0]: https://github.com/datafuselabs/opendal/compare/v0.10.0...v0.11.0
[v0.10.0]: https://github.com/datafuselabs/opendal/compare/v0.9.1...v0.10.0
[v0.9.1]: https://github.com/datafuselabs/opendal/compare/v0.9.0...v0.9.1
[v0.9.0]: https://github.com/datafuselabs/opendal/compare/v0.8.0...v0.9.0
diff --git a/Cargo.toml b/Cargo.toml
index d6cae6a..5f21fd0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@
license = "Apache-2.0"
name = "opendal"
repository = "https://github.com/datafuselabs/opendal"
-version = "0.10.0"
+version = "0.11.0"
[package.metadata.docs.rs]
all-features = true
diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md
index d1b9f5f..466656a 100644
--- a/docs/SUMMARY.md
+++ b/docs/SUMMARY.md
@@ -14,6 +14,7 @@
- [Walk Dir](examples/walk.md)
- [Remove a dir recursively](examples/remove_all.md)
- [Read compressed files](examples/decompress-read.md)
+ - [Generate presigned URL](examples/presign.md)
- [Enable Server Side Encrypt](examples/server-side-encryption.md)
- [Upgrade](upgrade.md)
diff --git a/docs/examples/presign.md b/docs/examples/presign.md
new file mode 100644
index 0000000..ff6f96e
--- /dev/null
+++ b/docs/examples/presign.md
@@ -0,0 +1,41 @@
+# Presign
+
+OpenDAL can presign an operation to generate a presigned URL.
+
+
+
+Refer to [RFC-0413: Presign](/rfcs/0413-presign.html) for more information.
+
+## Download
+
+```rust
+let op = Operator::from_env(Scheme::S3).await?;
+let signed_req = op.object("test").presign_read(Duration::hours(1))?;
+```
+
+- `signed_req.method()`: `GET`
+- `signed_req.uri()`: `https://s3.amazonaws.com/examplebucket/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=access_key_id/20130721/us-east-1/s3/aws4_request&X-Amz-Date=20130721T201207Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=<signature-value>`
+- `signed_req.headers()`: `{ "host": "s3.amazonaws.com" }`
+
+We can download this object via `curl` or other tools without credentials:
+
+```shell
+curl "https://s3.amazonaws.com/examplebucket/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=access_key_id/20130721/us-east-1/s3/aws4_request&X-Amz-Date=20130721T201207Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=<signature-value>" -O /tmp/test.txt
+```
+
+## Upload
+
+```rust
+let op = Operator::from_env(Scheme::S3).await?;
+let signed_req = op.object("test").presign_write(Duration::hours(1))?;
+```
+
+- `signed_req.method()`: `PUT`
+- `signed_req.uri()`: `https://s3.amazonaws.com/examplebucket/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=access_key_id/20130721/us-east-1/s3/aws4_request&X-Amz-Date=20130721T201207Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=<signature-value>`
+- `signed_req.headers()`: `{ "host": "s3.amazonaws.com" }`
+
+We can upload file as this object via `curl` or other tools without credential:
+
+```shell
+curl -X PUT "https://s3.amazonaws.com/examplebucket/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=access_key_id/20130721/us-east-1/s3/aws4_request&X-Amz-Date=20130721T201207Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=<signature-value>" -d "Hello, World!"
+```
diff --git a/docs/services/README.md b/docs/services/README.md
index 4dee607..6c81a20 100644
--- a/docs/services/README.md
+++ b/docs/services/README.md
@@ -2,6 +2,11 @@
This section will demonstrate how to init and start using a service.
+OpenDAL can init services via environment or builder.
+
+- Via Builder: use different backends' `Builder` API.
+- Via Environment: use `Operator::from_env()` API.
+
OpenDAL supports the following services:
- [azblob](./azblob.md): Azure blob storage service
diff --git a/docs/services/azblob.md b/docs/services/azblob.md
index 4b03869..4a71194 100644
--- a/docs/services/azblob.md
+++ b/docs/services/azblob.md
@@ -27,6 +27,22 @@
## Example
+### Via Environment
+
+```rust
+use anyhow::Result;
+use opendal::Operator;
+use opendal::Scheme;
+
+#[tokio::main]
+async fn main() -> Result<()> {
+ // Init Operator from env.
+ let op = Operator::from_env(Scheme::Azblob).await?;
+}
+```
+
+### Via Builder
+
```rust
{{#include ../../examples/azblob.rs:15:}}
```
diff --git a/docs/services/fs.md b/docs/services/fs.md
index 6472046..6c0077f 100644
--- a/docs/services/fs.md
+++ b/docs/services/fs.md
@@ -14,6 +14,22 @@
## Example
+### Via Environment
+
+```rust
+use anyhow::Result;
+use opendal::Operator;
+use opendal::Scheme;
+
+#[tokio::main]
+async fn main() -> Result<()> {
+ // Init Operator from env.
+ let op = Operator::from_env(Scheme::Fs).await?;
+}
+```
+
+### Via Builder
+
```rust
{{#include ../../examples/fs.rs:15:}}
```
diff --git a/docs/services/hdfs.md b/docs/services/hdfs.md
index 60dd308..6491b20 100644
--- a/docs/services/hdfs.md
+++ b/docs/services/hdfs.md
@@ -20,6 +20,22 @@
- `JAVA_HOME`
- `HADOOP_HOME`
+### Via Environment
+
+```rust
+use anyhow::Result;
+use opendal::Operator;
+use opendal::Scheme;
+
+#[tokio::main]
+async fn main() -> Result<()> {
+ // Init Operator from env.
+ let op = Operator::from_env(Scheme::Hdfs).await?;
+}
+```
+
+### Via Builder
+
```rust
{{#include ../../examples/hdfs.rs:15:}}
```
diff --git a/docs/services/s3.md b/docs/services/s3.md
index b1f6b38..50c11fc 100644
--- a/docs/services/s3.md
+++ b/docs/services/s3.md
@@ -125,6 +125,22 @@
## Example
+### Via Environment
+
+```rust
+use anyhow::Result;
+use opendal::Operator;
+use opendal::Scheme;
+
+#[tokio::main]
+async fn main() -> Result<()> {
+ // Init Operator from env.
+ let op = Operator::from_env(Scheme::S3).await?;
+}
+```
+
+### Via Builder
+
```rust
{{#include ../../examples/s3.rs:15:}}
```