mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-08-06 17:40:59 +00:00
feat(service/media): add deep hashed directory structure for S3
This commit is contained in:
parent
2c47045659
commit
59e4f4d8f1
3 changed files with 64 additions and 19 deletions
|
@ -250,6 +250,8 @@ impl From<IncompleteConfig> for Config {
|
|||
secret,
|
||||
duration,
|
||||
bucket_use_path,
|
||||
path,
|
||||
directory_structure,
|
||||
} => {
|
||||
let path_style = if bucket_use_path {
|
||||
rusty_s3::UrlStyle::Path
|
||||
|
@ -263,9 +265,11 @@ impl From<IncompleteConfig> for Config {
|
|||
let credentials = rusty_s3::Credentials::new(key, secret);
|
||||
|
||||
MediaBackendConfig::S3 {
|
||||
bucket: bucket,
|
||||
credentials: credentials,
|
||||
bucket,
|
||||
credentials,
|
||||
duration: Duration::from_secs(duration),
|
||||
path,
|
||||
directory_structure,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -517,6 +521,9 @@ pub enum IncompleteMediaBackendConfig {
|
|||
duration: u64,
|
||||
#[serde(default = "false_fn")]
|
||||
bucket_use_path: bool,
|
||||
path: Option<String>,
|
||||
#[serde(default)]
|
||||
directory_structure: DirectoryStructure,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -539,6 +546,8 @@ pub enum MediaBackendConfig {
|
|||
bucket: rusty_s3::Bucket,
|
||||
credentials: rusty_s3::Credentials,
|
||||
duration: Duration,
|
||||
path: Option<String>,
|
||||
directory_structure: DirectoryStructure,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue