Crates.io | qiniu-upload-manager |
lib.rs | qiniu-upload-manager |
version | 0.2.4 |
source | src |
created_at | 2022-04-07 10:00:14.6983 |
updated_at | 2023-12-26 08:06:47.432855 |
description | Qiniu Upload Manager for Rust |
homepage | https://www.qiniu.com |
repository | https://github.com/qiniu/rust-sdk.git |
max_upload_size | |
id | 563580 |
size | 585,824 |
基于 qiniu-apis
提供针对七牛对象的上传功能 (同时提供阻塞客户端和异步客户端,异步客户端则需要启用 async
功能)。
ureq
[dependencies]
qiniu-upload-manager = { version = "0.2.1", features = ["ureq"] }
[dependencies]
qiniu-upload-manager = { version = "0.2.1", features = ["async", "isahc"] }
[dependencies]
qiniu-upload-manager = { version = "0.2.1", features = ["async", "reqwest"] }
c_ares
启用 c-ares
库作为 DNS 解析器
trust_dns
启用 trust-dns
库作为 DNS 解析器
dns-over-https
启用 trust-dns
库作为 DNS 解析器,并使用 DOH 协议
dns-over-tls
启用 trust-dns
库作为 DNS 解析器,并使用 DOT 协议
use qiniu_upload_manager::{
apis::credential::Credential, AutoUploader, AutoUploaderObjectParams, UploadManager,
UploadTokenSigner,
};
use std::time::Duration;
let bucket_name = "test-bucket";
let object_name = "test-object";
let upload_manager = UploadManager::builder(UploadTokenSigner::new_credential_provider(
Credential::new("abcdefghklmnopq", "1234567890"),
bucket_name,
Duration::from_secs(3600),
))
.build();
let params = AutoUploaderObjectParams::builder().object_name(object_name).file_name(object_name).build();
let mut uploader: AutoUploader = upload_manager.auto_uploader();
uploader.upload_path("/home/qiniu/test.png", params)?;
use qiniu_upload_manager::{
apis::credential::Credential, AutoUploader, AutoUploaderObjectParams, UploadManager,
UploadTokenSigner,
};
use std::time::Duration;
let bucket_name = "test-bucket";
let object_name = "test-object";
let upload_manager = UploadManager::builder(UploadTokenSigner::new_credential_provider(
Credential::new("abcdefghklmnopq", "1234567890"),
bucket_name,
Duration::from_secs(3600),
))
.build();
let params = AutoUploaderObjectParams::builder().object_name(object_name).file_name(object_name).build();
let mut uploader: AutoUploader = upload_manager.auto_uploader();
uploader.async_upload_path("/home/qiniu/test.png", params).await?;
1.70.0
This project is licensed under the MIT license.