Giter Site home page Giter Site logo

xprazak2 / opendal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apache/opendal

0.0 2.0 0.0 2.05 MB

Open Data Access Layer that connect the whole world together.

Home Page: https://opendal.databend.rs

License: Apache License 2.0

Shell 0.19% Rust 99.81%

opendal's Introduction

OpenDAL โ€ƒ Build Status Latest Version

Open Data Access Layer that connect the whole world together.


You may be looking for:

Status

OpenDAL is in alpha stage and has been early adopted by databend. Welcome any feedback at Discussions!

Supported Services

  • azblob: Azure Storage Blob services.
  • fs: POSIX alike file system.
  • hdfs: Hadoop Distributed File System(HDFS).
  • memory: In memory backend.
  • s3: AWS S3 alike services.

Quickstart

use anyhow::Result;
use futures::StreamExt;
use opendal::services::fs;
use opendal::ObjectMode;
use opendal::Operator;
use opendal::Metadata;
use opendal::Object;
use opendal::ObjectStreamer;

#[tokio::main]
async fn main() -> Result<()> {
    // Init Operator
    let op = Operator::new(fs::Backend::build().root("/tmp").finish().await?);

    // Create object handler.
    let o: Object = op.object("test_file");

    // Write data info object;
    let _: () = o.write("Hello, World!").await?;

    // Read data from object;
    let bs: Vec<u8> = o.read().await?;

    // Read range from object;
    let bs: Vec<u8> = o.range_read(1..=11).await?;

    // Get object's Metadata
    let meta: Metadata = o.metadata().await?;
    let path: &str = meta.path();
    let mode: ObjectMode = meta.mode();
    let length: u64 = meta.content_length();
    let content_md5: Option<String> = meta.content_md5();

    // Delete object.
    let _: () = o.delete().await?;

    // List dir object.
    let o: Object = op.object("test_dir/");
    let mut obs: ObjectStreamer = o.list().await?;
    while let Some(entry) = obs.next().await {
        let entry: Object = entry?;
    }

    Ok(())
}

More examples could be found at examples.

Contributing

Check out the CONTRIBUTING.md guide for more details on getting started with contributing to this project.

Getting help

Submit issues for bug report or asking questions in discussion.

License

Licensed under Apache License, Version 2.0.

opendal's People

Contributors

xuanwo avatar d2lark avatar dependabot[bot] avatar sundy-li avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.