feat(ks3): add KS3 object storage support
Add Kingsoft Cloud KS3 as a supported storage provider, including backend service implementation, storage config UI, and provider scheme recognition throughout the codebase.
This commit is contained in:
@@ -126,6 +126,17 @@ func NewFileServiceFromStorageConfig(
|
||||
}
|
||||
return svc, p, err
|
||||
|
||||
case "ks3":
|
||||
if sec == nil || sec.KS3 == nil || sec.KS3.Endpoint == "" || sec.KS3.Region == "" || sec.KS3.AccessKey == "" || sec.KS3.SecretKey == "" || sec.KS3.BucketName == "" {
|
||||
return nil, p, fmt.Errorf("incomplete ks3 config")
|
||||
}
|
||||
pathPrefix := strings.TrimSpace(sec.KS3.PathPrefix)
|
||||
if pathPrefix == "" {
|
||||
pathPrefix = "weknora/"
|
||||
}
|
||||
svc, err := NewKS3FileService(sec.KS3.Endpoint, sec.KS3.Region, sec.KS3.AccessKey, sec.KS3.SecretKey, sec.KS3.BucketName, pathPrefix)
|
||||
return svc, p, err
|
||||
|
||||
default:
|
||||
return nil, p, fmt.Errorf("unsupported provider %q", p)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user