ve-tos-rust-sdk

Crates.iove-tos-rust-sdk
lib.rsve-tos-rust-sdk
version2.0.2
sourcesrc
created_at2024-03-17 10:49:00.383602
updated_at2024-09-06 02:02:08.679587
descriptionvolcengine offical tos rust sdk
homepage
repository
max_upload_size
id1176377
size826,227
(chewaiwai)

documentation

README

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());
    }
}
Commit count: 0

cargo fmt