pub struct CosConfig {
pub provider: String,
pub tencent: TencentCosConfig,
pub aliyun: AliyunOssConfig,
pub aws: AwsS3Config,
pub minio: MinioConfig,
pub huawei: HuaweiObsConfig,
pub rustfs: RustFsConfig,
}Expand description
对象存储配置
支持多种云存储服务商和本地文件系统
§字段说明
provider: 存储提供商,可选值:tencent/aliyun/aws/minio/huawei/rustfstencent: 腾讯云 COS 配置aliyun: 阿里云 OSS 配置aws: AWS S3 配置minio: MinIO 配置huawei: 华为云 OBS 配置rustfs: 本地文件系统配置
§示例
use admin_config::CosConfig;
let config = CosConfig {
provider: "tencent".to_string(),
..Default::default()
};Fields§
§provider: String对象存储提供商 (tencent/aliyun/aws/minio/huawei/rustfs)
tencent: TencentCosConfig腾讯云 COS 配置
aliyun: AliyunOssConfig阿里云 OSS 配置
aws: AwsS3ConfigAWS S3 配置
minio: MinioConfigMinIO 配置
huawei: HuaweiObsConfig华为云 OBS 配置
rustfs: RustFsConfigRustFS 本地文件系统配置
Implementations§
Source§impl CosConfig
impl CosConfig
Sourcepub fn get_bucket(&self) -> String
pub fn get_bucket(&self) -> String
获取当前提供商的存储桶名称
Sourcepub fn get_cdn_domain(&self) -> Option<String>
pub fn get_cdn_domain(&self) -> Option<String>
获取当前提供商的 CDN 域名
Sourcepub fn get_endpoint(&self) -> Option<String>
pub fn get_endpoint(&self) -> Option<String>
获取当前提供商的 Endpoint
Sourcepub fn get_root_path(&self) -> Option<String>
pub fn get_root_path(&self) -> Option<String>
获取本地文件系统的根路径(仅 RustFS)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CosConfig
impl<'de> Deserialize<'de> for CosConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CosConfig
impl RefUnwindSafe for CosConfig
impl Send for CosConfig
impl Sync for CosConfig
impl Unpin for CosConfig
impl UnwindSafe for CosConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more