tag | dda09c0b5c99eb579d68facf89ac2902be89d30f | |
---|---|---|
tagger | Xuanwo <github@xuanwo.io> | Tue Apr 25 23:52:13 2023 +0800 |
object | 8e12fed08e8ce20780f387a248593f06fd0cb10f |
Release 0.33.1
commit | 8e12fed08e8ce20780f387a248593f06fd0cb10f | [log] [tgz] |
---|---|---|
author | Xuanwo <github@xuanwo.io> | Tue Apr 25 23:51:58 2023 +0800 |
committer | GitHub <noreply@github.com> | Tue Apr 25 23:51:58 2023 +0800 |
tree | c550e775f7538dadc0f5d43ed41dd090473c29db | |
parent | ed1d362415e150fe929a7cb5a7e33ae3e9cb735a [diff] |
Bump to version 0.33.1 (#2123) * Bump to version 0.33.1 Signed-off-by: Xuanwo <github@xuanwo.io> * Update Signed-off-by: Xuanwo <github@xuanwo.io> --------- Signed-off-by: Xuanwo <github@xuanwo.io> Co-authored-by: Suyan <suyanhanx@gmail.com>
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