oss-sdk

Crates.iooss-sdk
lib.rsoss-sdk
version0.1.2
sourcesrc
created_at2021-09-11 06:00:19.619451
updated_at2021-10-18 07:57:49.588848
descriptionOSS rust SDK
homepage
repositoryhttps://github.com/mybee/oss-rust
max_upload_size
id449631
size37,355
(mybee)

documentation

README

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)
Commit count: 16

cargo fmt