Skip to content

Commit

Permalink
fix time format and cos client err
Browse files Browse the repository at this point in the history
  • Loading branch information
carldai committed Sep 5, 2022
1 parent 166b5f0 commit 99a3045
Show file tree
Hide file tree
Showing 2 changed files with 587 additions and 9 deletions.
22 changes: 13 additions & 9 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,18 @@ func NewCosClient(cred common.CredentialIface, conf *config.TencentConfig) (*cos
// 用于Get Service 查询, service域名暂时只支持外网
su, _ := url.Parse("http://cos." + conf.Credential.Region + ".myqcloud.com")
b := &cos.BaseURL{BucketURL: nil, ServiceURL: su}
//client := cos.NewClient(b, &http.Client{
// Transport: &cos.AuthorizationTransport{
// SecretID: conf.Credential.AccessKey,
// SecretKey: conf.Credential.SecretKey,
// },
//})
client := cos.NewClient(b, &http.Client{
Transport: common.NewCredentialTransport(cred.GetRole()),
})
client := &cos.Client{}
if conf.Credential.Role == "" {
client = cos.NewClient(b, &http.Client{
Transport: &cos.AuthorizationTransport{
SecretID: conf.Credential.AccessKey,
SecretKey: conf.Credential.SecretKey,
},
})
} else {
client = cos.NewClient(b, &http.Client{
Transport: common.NewCredentialTransport(cred.GetRole()),
})
}
return client, nil
}
Loading

0 comments on commit 99a3045

Please sign in to comment.