1 个稳定版本
2.0.1 | 2024 年 3 月 18 日 |
---|---|
2.0.0 |
|
#2111 in Web 编程
每月 26 次下载
420KB
9K SLoC
火山引擎对象存储(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());
}
}
依赖项
~7–24MB
~323K SLoC