1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! # 腾讯云 COS Rust SDK
//!
//! 这是一个用于腾讯云对象存储(COS)的 Rust SDK,提供了完整的 COS API 功能。
//!
//! ## 快速开始
//!
//! ```rust
//! use cos_rust_sdk::{Config, CosClient, ObjectClient};
//! use std::time::Duration;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // 创建配置
//! let config = Config::new(
//! "your-secret-id",
//! "your-secret-key",
//! "ap-beijing",
//! "your-bucket-name-appid"
//! ).with_timeout(Duration::from_secs(30));
//!
//! // 创建客户端
//! let cos_client = CosClient::new(config)?;
//! let object_client = ObjectClient::new(cos_client.clone());
//!
//! // 上传文件
//! let data = b"Hello, COS!";
//! object_client.put_object("test.txt", data.to_vec(), Some("text/plain")).await?;
//!
//! // 下载文件
//! let response = object_client.get_object("test.txt").await?;
//! println!("Downloaded: {}", String::from_utf8_lossy(&response.data));
//!
//! Ok(())
//! }
//! ```
// 重新导出主要类型
pub use Auth;
pub use ;
pub use CosClient;
pub use Config;
pub use ;
pub use ;
pub use ;
/// SDK 版本
pub const VERSION: &str = env!;
/// 用户代理字符串
pub const USER_AGENT: &str = concat!;