5 releases

0.1.2 Oct 18, 2021
0.1.1 Oct 18, 2021
0.1.0 Oct 14, 2021
0.0.2 Sep 11, 2021
0.0.1 Sep 11, 2021

#13 in #oss

Apache-2.0

38KB
1K SLoC

Getting Started

Get Object async

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)?

Put Object by file

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)

MultipartUpload for big file

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);

Delete Ojbect

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)

Dependencies

~12–26MB
~342K SLoC