- update storage

master
李光春 1 year ago
parent efdef3152a
commit af820fe08c

@ -1,5 +1,5 @@
package go_library
func Version() string {
return "1.0.117"
return "1.0.118"
}

@ -35,10 +35,22 @@ func NewAliYun(config *AliYunConfig) (*AliYun, error) {
app.endpoint = config.Endpoint
app.bucketName = config.BucketName
// 创建链接
app.client, app.error = oss.New(app.endpoint, app.accessKeyId, app.accessKeySecret)
if app.error != nil {
return nil, app.error
}
// 填写存储空间名称
app.bucket, app.error = app.client.Bucket(app.bucketName)
if app.error != nil {
return nil, app.error
}
// 判断存储空间是否存在
_, app.error = app.client.IsBucketExist(app.bucketName)
if app.error != nil {
return nil, app.error
}
return app, nil
}

Loading…
Cancel
Save