tu6ge / oss-rs Goto Github PK
View Code? Open in Web Editor NEW一个阿里云 OSS 的 rust 客户端
一个阿里云 OSS 的 rust 客户端
We can use STS token to access aliyun OSS. The additional work is to add x-oss-security-token
header. I think it'll be nice to support this in the SDK. But it'seems that it might be a bit difficult to add this.
My recent job may not be good enough, but still leave here: https://github.com/yin1999/aliyun-oss-sdk-rust/tree/support-sts-token
参考demo里的查询当前 bucket 中的 object 列表,但是返回值 object_list 里的 Object 都是私有属性,无法获取 size
和 last_modified
等值
在object.rs中
impl SetObjectPath for Url {
fn set_object_path(&mut self, path: &ObjectPathInner) {
self.set_path(path.as_ref());
}
}
需要对path进行urlencode,不然如果路径中包含中文或者特殊字符签名会报错
作者您好,我是一名初学者,看了一些语法希望直接在项目中继续加深认知,请问当前这个项目可以添加一些详细的启动运行和调试的步骤简介吗?盼您回复~
https://help.aliyun.com/document_detail/31952.html?spm=a2c4g.31951.0.0.4a1a50c56q34Fo
这个里面的签名认证用这个crate可以实现吗
使用put_file上传一个.log文件时会提示file type is known错误,
是否能为put_file提供mime_type的设置入口?不然put_file的可用性就比较低了。
看到内部使用了infer模块,但没有定义像.md
, .log
之类的文本文件的类型,这时就只能使用put_content
方法自己定义content_type
了。
https://github.com/tu6ge/oss-rs/blob/branch0.9/src/object.rs#L180
这里的key
在未来版本弃用的话,object 的 name 就无法获取到了吧?
比如某些场景需要显示 object 列表,name 应该是有必要的。
type.rs的Endpoint中,美东美西的字符串应该为:"us-east-1",不是:“us-east1",导致域名解析错误
Line 684 in 977db3f
如果是CommonPrefixes
,末尾带/
,这里的会报错
<CommonPrefixes>
<Prefix>apk/2.0.1/</Prefix>
</CommonPrefixes>
// 获取客户端实例
let client = aliyun_oss_client::client(key_id,key_secret, endpoint, bucket);
thread 'main' panicked at 'called Res ult::unwrap()
on an Err
value: Inva
lidEndPoint', /root/.cargo/registry/sr
c/github.com-1ecc6299db9ec823/aliyun-o
ss-client-0.10.1/src/types.rs:197:25
stack backtrace:
需要判断bucket中是否存在某个object应该怎么做, 好像没有实现head_object方法
endpoint as_ref 方法里面缺少对 is_internal 的处理,导致 internal 无效。
fn as_ref(&self) -> &str {
use EndPointKind::*;
let ret = match &self.kind {
CnHangzhou => HANGZHOU,
CnShanghai => SHANGHAI,
CnQingdao => QINGDAO,
CnBeijing => BEIJING,
CnZhangjiakou => ZHANGJIAKOU,
CnHongkong => HONGKONG,
CnShenzhen => SHENZHEN,
UsWest1 => US_WEST1,
UsEast1 => US_EAST1,
ApSouthEast1 => AP_SOUTH_EAST1,
Other(str) => str,
};
if (self.is_internal) {
ret + OSS_INTERNAL
} else {
ret
}
}
使用get_object下载图片,图片的体积会增加1倍左右,且文件打不开,但是下载json是正常的,代码:
let content= client.get_object("demo.png", ..).await;
if content.is_ok() {
let data = &content.unwrap();
println!("data长度: {}", data.len());
let mut file = File::create("demo.png").unwrap();
file.write_all(data).unwrap();
}
该如何修改?
例如 reqwest
Line 31 in 3c04fbd
这里的next_continuation_token
是不是暴露出来会更灵活一些,现在异步的方式没有相应的方法可以获取下一页数据
this is the result when i use nodejs to test.
When using prefix and delimiter to query together, prefixes
means the sub folder that contains prefix。in my case, i print &response.prefix()
only the last one string.
reference:
https://help.aliyun.com/document_detail/84841.html#p-awp-qxy-gu1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.