| tag | 123fcad0d24c9fca28f3d92aee451ecf20b09aa2 | |
|---|---|---|
| tagger | Xuanwo <github@xuanwo.io> | Wed Feb 23 17:50:48 2022 +0800 |
| object | 81f646a6f83e0c65aaa496f80dd2093243c3cc76 |
Bump to version 0.0.4
| commit | 81f646a6f83e0c65aaa496f80dd2093243c3cc76 | [log] [tgz] |
|---|---|---|
| author | Xuanwo <github@xuanwo.io> | Wed Feb 23 17:50:22 2022 +0800 |
| committer | GitHub <noreply@github.com> | Wed Feb 23 17:50:22 2022 +0800 |
| tree | c1de1db174e3c133b44aefb785eb61b569aefdbd | |
| parent | c465bb6e594d8cfdff68332111a67abea2e89cf5 [diff] |
Bump to version 0.0.4 (#45) Signed-off-by: Xuanwo <github@xuanwo.io>
Open Data Access Layer that connect the whole world together.
OpenDAL is in alpha stage and has been early adopted by databend. Welcome any feedback at Discussions!
use anyhow::Result; use futures::AsyncReadExt; use opendal::services::fs; use opendal::Operator; #[tokio::main] async fn main() -> Result<()> { let op = Operator::new(fs::Backend::build().root("/tmp").finish().await?); let o = op.object("test_file"); // Write data info file; let w = o.new_writer(); let n = w .write_bytes("Hello, World!".to_string().into_bytes()) .await?; assert_eq!(n, 13); // Read data from file; let mut r = o.new_reader(); let mut buf = vec![]; let n = r.read_to_end(&mut buf).await?; assert_eq!(n, 13); assert_eq!(String::from_utf8_lossy(&buf), "Hello, World!"); // Get file's Metadata let meta = o.stat().await?; assert_eq!(meta.content_length(), 13); // Delete file. o.delete().await?; Ok(()) }
OpenDAL is licensed under Apache 2.0.