OpenDAL
Open Data Access Layer that connect the whole world together.
Status
OpenDAL is in alpha stage and has been early adopted by databend. Welcome any feedback at Discussions!
Quickstart
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");
let w = o.writer();
let n = w
.write_bytes("Hello, World!".to_string().into_bytes())
.await?;
assert_eq!(n, 13);
let mut r = o.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!");
let meta = o.metadata().await?;
assert_eq!(meta.content_length(), 13);
o.delete().await?;
Ok(())
}
Contributing
Check out the CONTRIBUTING.md guide for more details on getting started with contributing to this project.
License
OpenDAL is licensed under Apache 2.0.