Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to version 0.4.2 #216

Merged
merged 4 commits into from
Apr 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/)
and this project adheres to [Semantic Versioning](https://semver.org/).

## [v0.4.2] - 2022-04-03

### Added

- feat: Add seekable_reader on Object (#215)

### Fixed

- fix: Object last_modified should carry timezone (#217)

## [v0.4.1] - 2022-04-02

### Added
Expand Down Expand Up @@ -232,6 +242,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

Hello, OpenDAL!

[v0.4.2]: https://github.com/datafuselabs/opendal/compare/v0.4.1...v0.4.2
[v0.4.1]: https://github.com/datafuselabs/opendal/compare/v0.4.0...v0.4.1
[v0.4.0]: https://github.com/datafuselabs/opendal/compare/v0.3.0...v0.4.0
[v0.3.0]: https://github.com/datafuselabs/opendal/compare/v0.2.5...v0.3.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords = ["storage", "data", "s3", "fs"]
license = "Apache-2.0"
name = "opendal"
repository = "https://github.com/datafuselabs/opendal"
version = "0.4.1"
version = "0.4.2"

[workspace]
members = ["opendal_test"]
Expand Down
43 changes: 23 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,44 @@ OpenDAL is in **alpha** stage and has been early adopted by [databend](https://g

```rust
use anyhow::Result;
use futures::AsyncReadExt;
use futures::StreamExt;
use opendal::services::fs;
use opendal::ObjectMode;
use opendal::Operator;
use opendal::Metadata;
use opendal::Object;
use opendal::ObjectStreamer;

#[tokio::main]
async fn main() -> Result<()> {
// Init Operator
let op = Operator::new(fs::Backend::build().root("/tmp").finish().await?);

let o = op.object("test_file");
// Create object handler.
let o: Object = op.object("test_file");

// Write data info file;
let _ = o.write("Hello, World!").await?;
// Write data info object;
let _: () = o.write("Hello, World!").await?;

// Read data from file;
let bs = o.read().await?;
// Read data from object;
let bs: Vec<u8> = o.read().await?;

// Read range from file;
let bs = o.range_read(1..=11).await?;
// Read range from object;
let bs: Vec<u8> = o.range_read(1..=11).await?;

// Get file's Metadata
let meta = o.metadata().await?;
// Get object's Metadata
let meta: Metadata = o.metadata().await?;
let path: &str = meta.path();
let mode: ObjectMode = meta.mode();
let length: u64 = meta.content_length();
let content_md5: Option<String> = meta.content_md5();

// List dir.
let mut obs = op.objects("").await?.map(|o| o.expect("list object"));
while let Some(o) = obs.next().await {
let meta = o.metadata().await?;
let path = meta.path();
let mode = meta.mode();
let length = meta.content_length();
}
// List dir object.
let mut obs: ObjectStreamer = op.objects("").await?;
while let Some(o) = obs.next().await {}

// Delete file.
o.delete().await?;
// Delete object.
let _: () = o.delete().await?;

Ok(())
}
Expand Down
43 changes: 23 additions & 20 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,44 @@
//!
//! ```
//! use anyhow::Result;
//! use futures::AsyncReadExt;
//! use futures::StreamExt;
//! use opendal::services::fs;
//! use opendal::ObjectMode;
//! use opendal::Operator;
//! use opendal::Metadata;
//! use opendal::Object;
//! use opendal::ObjectStreamer;
//!
//! #[tokio::main]
//! async fn main() -> Result<()> {
//! // Init Operator
//! let op = Operator::new(fs::Backend::build().root("/tmp").finish().await?);
//!
//! let o = op.object("test_file");
//! // Create object handler.
//! let o: Object = op.object("test_file");
//!
//! // Write data info file;
//! let _ = o.write("Hello, World!").await?;
//! // Write data info object;
//! let _: () = o.write("Hello, World!").await?;
//!
//! // Read data from file;
//! let bs = o.read().await?;
//! // Read data from object;
//! let bs: Vec<u8> = o.read().await?;
//!
//! // Read range from file;
//! let bs = o.range_read(1..=11).await?;
//! // Read range from object;
//! let bs: Vec<u8> = o.range_read(1..=11).await?;
//!
//! // Get file's Metadata
//! let meta = o.metadata().await?;
//! // Get object's Metadata
//! let meta: Metadata = o.metadata().await?;
//! let path: &str = meta.path();
//! let mode: ObjectMode = meta.mode();
//! let length: u64 = meta.content_length();
//! let content_md5: Option<String> = meta.content_md5();
//!
//! // List dir.
//! let mut obs = op.objects("").await?.map(|o| o.expect("list object"));
//! while let Some(o) = obs.next().await {
//! let meta = o.metadata().await?;
//! let path = meta.path();
//! let mode = meta.mode();
//! let length = meta.content_length();
//! }
//! // List dir object.
//! let mut obs: ObjectStreamer = op.objects("").await?;
//! while let Some(o) = obs.next().await {}
//!
//! // Delete file.
//! o.delete().await?;
//! // Delete object.
//! let _: () = o.delete().await?;
//!
//! Ok(())
//! }
Expand Down