cloud drive: add support for Baidu BOS
This commit is contained in:
@@ -27,15 +27,16 @@ func (s AliyunRemoteStorageMaker) Make(conf *filer_pb.RemoteConf) (remote_storag
|
||||
|
||||
config := &aws.Config{
|
||||
Endpoint: aws.String(conf.AliyunEndpoint),
|
||||
Region: aws.String(conf.AliyunRegion),
|
||||
S3ForcePathStyle: aws.Bool(false),
|
||||
}
|
||||
if conf.AliyunAccessKey != "" && conf.AliyunSecretKey != "" {
|
||||
if accessKey != "" && secretKey != "" {
|
||||
config.Credentials = credentials.NewStaticCredentials(accessKey, secretKey, "")
|
||||
}
|
||||
|
||||
sess, err := session.NewSession(config)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("create aws session: %v", err)
|
||||
return nil, fmt.Errorf("create aliyun session: %v", err)
|
||||
}
|
||||
client.conn = s3.New(sess)
|
||||
return client, nil
|
||||
|
||||
Reference in New Issue
Block a user