| commit | 3dca5c36942a5e765e4b102e8721fefa13e631d7 | [log] [tgz] |
|---|---|---|
| author | ClSlaid <cailue@bupt.edu.cn> | Wed Aug 17 14:36:27 2022 +0800 |
| committer | GitHub <noreply@github.com> | Wed Aug 17 14:36:27 2022 +0800 |
| tree | 52e748dbfd5a0d0695fc080933d3d2f1f6cf68a1 | |
| parent | d6cbd898ae2826d5b2327b90a577b6b33b6680da [diff] |
docs: Add docs for gcs backend (#535) * docs: final works for GCS backend support 1. add documentations for GCS backend 2. add a runnable example for GCS backend Signed-off-by: ClSlaid <cailue@bupt.edu.cn> * refactor: fix typo in gcs example Signed-off-by: ClSlaid <cailue@bupt.edu.cn> * refactor: make docs compile 1. add more document comment in lib.rs services/gcs/mod.rs 2. fix typo in examples/gcs.rs Signed-off-by: ClSlaid <cailue@bupt.edu.cn> * refactor: make clippy happy Signed-off-by: ClSlaid <cailue@bupt.edu.cn> Signed-off-by: ClSlaid <cailue@bupt.edu.cn> Co-authored-by: Xuanwo <github@xuanwo.io>
Open Data Access Layer: Access data freely, painless, and efficiently
You may be looking for:
Layeruse anyhow::Result; use futures::StreamExt; use futures::TryStreamExt; use opendal::DirEntry; use opendal::DirStreamer; use opendal::Object; use opendal::ObjectMetadata; use opendal::ObjectMode; use opendal::Operator; use opendal::Scheme; #[tokio::main] async fn main() -> Result<()> { // Init Operator let op = Operator::from_env(Scheme::Fs)?; // Create object handler. let o = op.object("test_file"); // Write data info object; o.write("Hello, World!").await?; // Read data from object; let bs = o.read().await?; // Read range from object; let bs = o.range_read(1..=11).await?; // Get object's path let name = o.name(); let path = o.path(); // Fetch more meta about object. let meta = o.metadata().await?; let mode = meta.mode(); let length = meta.content_length(); let content_md5 = meta.content_md5(); let etag = meta.etag(); // Delete object. o.delete().await?; // List dir object. let o = op.object("test_dir/"); let mut ds = o.list().await?; while let Some(entry) = ds.try_next().await? { let path = entry.path(); let mode = entry.mode(); } Ok(()) }
More examples could be found at Documentation.
Check out the CONTRIBUTING.md guide for more details on getting started with contributing to this project.
Submit issues for bug report or asking questions in discussion.