Skip to content

Releases: bgpkit/oneio

V0.11.0

20 Jul 23:05
8634bf1
Compare
Choose a tag to compare

What's new

  • clean up build flags, reduce default features to remote + compression

Full Changelog: v0.10.1...v0.11.0

V0.10.1 Bug fix, `s3_exists()`

12 May 00:07
32eba28
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.10.0...v0.10.1

V0.10.0 S3 operations

08 May 04:49
61be8c4
Compare
Choose a tag to compare

V0.10.0: S3 operations

New

  • [#13]: Add S3-related functionalities

Example:

use oneio::{s3_download, s3_list, s3_reader, s3_stats, s3_upload};
use std::io::Read;

/// This example shows how to upload a file to S3 and read it back.
///
/// You need to set the following environment variables (e.g. in .env):
/// - AWS_ACCESS_KEY_ID
/// - AWS_SECRET_ACCESS_KEY
/// - AWS_REGION (e.g. "us-east-1") (use "auto" for Cloudflare R2)
/// - AWS_ENDPOINT
fn main() {
    // upload to S3
    s3_upload("oneio-test", "test/README.md", "README.md").unwrap();

    // read directly from S3
    let mut content = String::new();
    s3_reader("oneio-test", "test/README.md")
        .unwrap()
        .read_to_string(&mut content)
        .unwrap();
    println!("{}", content);

    // download from S3
    s3_download("oneio-test", "test/README.md", "test/README-2.md").unwrap();

    // get S3 file stats
    let res = s3_stats("oneio-test", "test/README.md").unwrap();
    dbg!(res);

    // error if file does not exist
    let res = s3_stats("oneio-test", "test/README___NON_EXISTS.md");
    assert!(res.is_err());

    // list S3 files
    let res = s3_list("oneio-test", "test/", Some("/")).unwrap();
    dbg!(res);
}

Full Changelog: v0.9.0...v0.10.0

V0.9.0: error on 4XX, 5XX codes

02 May 17:54
fb12cf3
Compare
Choose a tag to compare

What's Changed

  • return error when fail to open remote files by @digizeph in #11

Full Changelog: v0.8.1...v0.9.0

V0.8.1

30 Mar 22:29
0c03f72
Compare
Choose a tag to compare

What's Changed

  • fix confusing cache_file_name vs cache_file_path issue by @digizeph in #10

Full Changelog: v0.8.0...v0.8.1

V0.8.0: `impl Send`, formatting, custom error

12 Mar 16:27
9987eb5
Compare
Choose a tag to compare

V0.8.0: impl Send, format, custom error

New

  • [#7]: add impl Send for all reader functions
    • from Box<dyn Read> to Box<dyn Read + Send>
    • this allows the reader to be used across threads

Refactor

  • [#8]: refactor custom Errors to use thiserror for implementation
  • [#9]: apply rustfmt and enforce formatting in CI checks