| tag | 7457d96abd02ff4c7e091a2f7901b7d05cf63c36 | |
|---|---|---|
| tagger | Xuanwo <github@xuanwo.io> | Wed Apr 12 11:50:54 2023 +0800 |
| object | 104dfd06b99a52b4f6050e683db83f009c33c3b3 |
Release v0.31.0
| commit | 104dfd06b99a52b4f6050e683db83f009c33c3b3 | [log] [tgz] |
|---|---|---|
| author | Xuanwo <github@xuanwo.io> | Wed Apr 12 11:50:26 2023 +0800 |
| committer | GitHub <noreply@github.com> | Wed Apr 12 11:50:26 2023 +0800 |
| tree | 2dd063a7fd29c013d379fee4b3574abc919849ba | |
| parent | 7504b93af83aa95e2b3877bbe65c64dc41ca2aa8 [diff] |
Bump to version 0.31 (#1916) * Bump to version 0.31 Signed-off-by: Xuanwo <github@xuanwo.io> * Fix typo Signed-off-by: Xuanwo <github@xuanwo.io> --------- Signed-off-by: Xuanwo <github@xuanwo.io>
Open Data Access Layer: Access data freely, painlessly, and efficiently

use opendal::Result; use opendal::layers::LoggingLayer; use opendal::services; use opendal::Operator; #[tokio::main] async fn main() -> Result<()> { // Pick a builder and configure it. let mut builder = services::S3::default(); builder.bucket("test"); // Init an operator let op = Operator::new(builder)? // Init with logging layer enabled. .layer(LoggingLayer::default()) .finish(); // Write data op.write("hello.txt", "Hello, World!").await?; // Read data let bs = op.read("hello.txt").await?; // Fetch metadata let meta = op.stat("hello.txt").await?; let mode = meta.mode(); let length = meta.content_length(); // Delete op.delete("hello.txt").await?; Ok(()) }
import asyncio async def main(): op = opendal.AsyncOperator("fs", root="/tmp") await op.write("test.txt", b"Hello World") print(await op.read("test.txt")) asyncio.run(main())
import { Operator } from "opendal"; async function main() { const op = new Operator("fs", { root: "/tmp" }); await op.write("test", "Hello, World!"); const bs = await op.read("test"); console.log(new TextDecoder().decode(bs)); const meta = await op.stat("test"); console.log(`contentLength: ${meta.contentLength}`); }
Submit issues for bug report or asking questions in the Discussions forum.
Talk to develops at discord.
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0