Make the S3 backend compatible with minio

This commit is contained in:
Gilbert Chen
2017-07-11 13:45:06 -04:00
parent 0aa122609a
commit f8764a5a79
3 changed files with 12 additions and 6 deletions

View File

@@ -23,7 +23,7 @@ type S3Storage struct {
// CreateS3Storage creates a amazon s3 storage object.
func CreateS3Storage(regionName string, endpoint string, bucketName string, storageDir string,
accessKey string, secretKey string, threads int) (storage *S3Storage, err error) {
accessKey string, secretKey string, threads int, isMinioCompatible bool) (storage *S3Storage, err error) {
token := ""
@@ -53,7 +53,9 @@ func CreateS3Storage(regionName string, endpoint string, bucketName string, stor
Region: aws.String(regionName),
Credentials: auth,
Endpoint: aws.String(endpoint),
}
S3ForcePathStyle: aws.Bool(isMinioCompatible),
DisableSSL: aws.Bool(isMinioCompatible),
}
if len(storageDir) > 0 && storageDir[len(storageDir) - 1] != '/' {
storageDir += "/"