5 个版本
0.1.2 | 2021 年 10 月 18 日 |
---|---|
0.1.1 | 2021 年 10 月 18 日 |
0.1.0 | 2021 年 10 月 14 日 |
0.0.2 | 2021 年 9 月 11 日 |
0.0.1 | 2021 年 9 月 11 日 |
#18 in #oss
38KB
1K SLoC
入门指南
异步获取对象
let oss_instance = OSS::new("your_AccessKeyId", "your_AccessKeySecret", "your_Endpoint", "your_Bucket");
let buf = oss_instance.get_object("objectName", None, None).await;
String::from_utf8(buf)?
通过文件上传对象
let filename = "filename";
let oss_instance = OSS::new("your_AccessKeyId", "your_AccessKeySecret", "your_Endpoint", "your_Bucket");
let result = oss_instance.put_object_from_file(filename, "object", None, None).await;
assert_eq!(result.is_ok(), true)
大文件的多部分上传
let filename = "filename";
let oss_instance = OSS::new("your_AccessKeyId", "your_AccessKeySecret", "your_Endpoint", "your_Bucket");
let object_name = "object_name";
let file = "/tmp/tmp.txt";
let chunk_size = 102400;
let res = oss_instance.chunk_upload_by_size(object_name, file, chunk_size).await;
println!("res: {:?}", res);
删除对象
let oss_instance = OSS::new("your_AccessKeyId", "your_AccessKeySecret", "your_Endpoint", "your_Bucket");
let result = oss_instance.delete_object("object").await;
assert_eq!(result.is_ok(), true)
依赖项
~12–23MB
~346K SLoC