feat(s3): support setting for force using path style endpoint (#1559)

This commit is contained in:
HFO4
2022-12-16 16:54:58 +08:00
parent 6ceb255512
commit 4e8ab75211
2 changed files with 11 additions and 8 deletions

View File

@@ -65,6 +65,9 @@ type PolicyOption struct {
TPSLimit float64 `json:"tps_limit,omitempty"`
// 每秒 API 请求爆发上限
TPSLimitBurst int `json:"tps_limit_burst,omitempty"`
// Set this to `true` to force the request to use path-style addressing,
// i.e., `http://s3.amazonaws.com/BUCKET/KEY `
S3ForcePathStyle bool `json:"s3_path_style"`
}
// thumbSuffix 支持缩略图处理的文件扩展名
@@ -122,7 +125,7 @@ func (policy *Policy) BeforeSave() (err error) {
return err
}
//SerializeOptions 将序列后的Option写入到数据库字段
// SerializeOptions 将序列后的Option写入到数据库字段
func (policy *Policy) SerializeOptions() (err error) {
optionsValue, err := json.Marshal(&policy.OptionsSerialized)
policy.Options = string(optionsValue)