0.2.2
WIP. 计划只支持基本的 obs 操作。
cargo add huaweicloud-sdk-rust-obs
2.示例
#[tokio::main] async fn main() -> Result<(), ObsError> { const DEFAULT_BUCKET_NAME:&str = "test_bucket"; let endpoint = "https://obs.ap-southeast-1.myhuaweicloud.com"; // see: https://support.huaweicloud.com/api-obs/obs_04_0116.html let ak = "xxx"; let sk = "xxxxxx"; let obs = client::Client::builder() .endpoint(endpoint) .security_provider(ak, sk) .build()?; // put object let object = include_bytes!("testdata/test.jpeg"); obs.put_object(DEFAULT_BUCKET_NAME, "obs-client-key.jpeg", object) .await?; Ok(()) }
.env
OBS_AK=XXXXXXXXXXXXXXX OBS_SK=XXXXXXXXXXXXXXXXXXXX
tests/common/mod.rs
DEFAULT_BUCKET_NAME
cargo test
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Huaweicloud OBS SDK (unofficial)
基本使用
2.示例
测试
.env
文件,内容格式如下:tests/common/mod.rs
下的DEFAULT_BUCKET_NAME
替换为自己的 bucket 名称cargo test