7
0

3.加凭证可以被json 和 yaml 解释

This commit is contained in:
liangzy 2020-08-08 17:53:47 +08:00
parent c2428de635
commit b7e56e1291
2 changed files with 9 additions and 9 deletions

View File

@ -1,15 +1,15 @@
package credentials package credentials
type BaseCredential struct { type BaseCredential struct {
AccessKeyId string AccessKeyId string `json:"access_key_id" yaml:"access_key_id"`
AccessKeySecret string AccessKeySecret string `json:"access_key_secret" yaml:"access_key_secret"`
AccessKeyFrom string AccessKeyFrom string `json:"access_key_from" yaml:"access_key_from"`
} }
type AccessKeyCredential struct { type AccessKeyCredential struct {
AccessKeyId string AccessKeyId string `json:"access_key_id" yaml:"access_key_id"`
AccessKeySecret string AccessKeySecret string `json:"access_key_secret" yaml:"access_key_secret"`
AccessKeyFrom string AccessKeyFrom string `json:"access_key_from" yaml:"access_key_from"`
} }
func (baseCred *BaseCredential) ToAccessKeyCredential() *AccessKeyCredential { func (baseCred *BaseCredential) ToAccessKeyCredential() *AccessKeyCredential {

View File

@ -1,9 +1,9 @@
package credentials package credentials
type StdTokenCredential struct { type StdTokenCredential struct {
AccessKeyId string AccessKeyId string `json:"access_key_id" yaml:"access_key_id"`
AccessKeySecret string AccessKeySecret string `json:"access_key_secret" yaml:"access_key_secret"`
AccessKeyFrom string AccessKeyFrom string `json:"access_key_from" yaml:"access_key_from"`
} }
func NewStsTokenCredential(accessKeyId, accessKeySecret, accessFrom string) *StdTokenCredential { func NewStsTokenCredential(accessKeyId, accessKeySecret, accessFrom string) *StdTokenCredential {