#object-storage #sdk #volcengine #tos #bucket #bucket-api

ve-tos-rust-sdk

volcengine offical tos rust sdk

2 stable releases

2.0.2 Sep 6, 2024
2.0.1 Mar 18, 2024
2.0.0 Mar 17, 2024

#1743 in Web programming

Download history 18/week @ 2024-07-24 8/week @ 2024-07-31 1/week @ 2024-08-07 8/week @ 2024-08-14 68/week @ 2024-08-21 8/week @ 2024-08-28 142/week @ 2024-09-04 13/week @ 2024-09-11 16/week @ 2024-09-18 21/week @ 2024-09-25 7/week @ 2024-10-02

161 downloads per month

Apache-2.0

425KB
9K SLoC

Volcengine Object Storage(TOS) Rust SDK

use std::env;

use ve_tos_rust_sdk::bucket::{BucketAPI, ListBucketsInput};
use ve_tos_rust_sdk::tos;

fn main() {
    let ak = env::var("TOS_ACCESS_KEY").unwrap_or("".to_string());
    let sk = env::var("TOS_SECRET_KEY").unwrap_or("".to_string());
    let endpoint = "https://tos-cn-beijing.volces.com";
    let region = "cn-beijing";
    let client = tos::builder()
        .connection_timeout(3000)
        .request_timeout(10000)
        .max_retry_count(3)
        .ak(ak)
        .sk(sk)
        .region(region)
        .endpoint(endpoint)
        .build().unwrap();

    let o = client.list_buckets(&ListBucketsInput::new()).unwrap();
    for bucket in o.buckets() {
        println!("{}", bucket.name());
    }
}

Dependencies

~8–22MB
~314K SLoC