|
|
|
@ -102,13 +102,13 @@ func (c *AliYun) configEndpoint(wg *sync.WaitGroup) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 填写存储空间名称
|
|
|
|
|
c.endpointInfo.bucket, c.endpointInfo.error = c.client.Bucket(c.bucketName)
|
|
|
|
|
c.endpointInfo.bucket, c.endpointInfo.error = c.endpointInfo.client.Bucket(c.bucketName)
|
|
|
|
|
if c.endpointInfo.error != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 判断存储空间是否存在
|
|
|
|
|
_, c.endpointInfo.error = c.client.IsBucketExist(c.bucketName)
|
|
|
|
|
_, c.endpointInfo.error = c.endpointInfo.client.IsBucketExist(c.bucketName)
|
|
|
|
|
if c.endpointInfo.error != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -132,13 +132,13 @@ func (c *AliYun) configEndpointEcs(wg *sync.WaitGroup) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 填写存储空间名称
|
|
|
|
|
c.endpointEcsInfo.bucket, c.endpointEcsInfo.error = c.client.Bucket(c.bucketName)
|
|
|
|
|
c.endpointEcsInfo.bucket, c.endpointEcsInfo.error = c.endpointEcsInfo.client.Bucket(c.bucketName)
|
|
|
|
|
if c.endpointEcsInfo.error != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 判断存储空间是否存在
|
|
|
|
|
_, c.endpointEcsInfo.error = c.client.IsBucketExist(c.bucketName)
|
|
|
|
|
_, c.endpointEcsInfo.error = c.endpointEcsInfo.client.IsBucketExist(c.bucketName)
|
|
|
|
|
if c.endpointEcsInfo.error != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -163,13 +163,13 @@ func (c *AliYun) configEndpointAccelerate(wg *sync.WaitGroup) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 填写存储空间名称
|
|
|
|
|
c.endpointAccelerateInfo.bucket, c.endpointAccelerateInfo.error = c.client.Bucket(c.bucketName)
|
|
|
|
|
c.endpointAccelerateInfo.bucket, c.endpointAccelerateInfo.error = c.endpointAccelerateInfo.client.Bucket(c.bucketName)
|
|
|
|
|
if c.endpointAccelerateInfo.error != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 判断存储空间是否存在
|
|
|
|
|
_, c.endpointAccelerateInfo.error = c.client.IsBucketExist(c.bucketName)
|
|
|
|
|
_, c.endpointAccelerateInfo.error = c.endpointAccelerateInfo.client.IsBucketExist(c.bucketName)
|
|
|
|
|
if c.endpointAccelerateInfo.error != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -179,12 +179,6 @@ func (c *AliYun) configEndpointAccelerate(wg *sync.WaitGroup) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Bucket 存储空间
|
|
|
|
|
func (c *AliYun) Bucket(name string) *AliYun {
|
|
|
|
|
c.bucket, c.error = c.client.Bucket(name)
|
|
|
|
|
return c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PutObject 上传文件流
|
|
|
|
|
// @param file 文件流
|
|
|
|
|
// @param filePath 文件路径
|
|
|
|
|