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
type BaseCredential struct {
AccessKeyId string
AccessKeySecret string
AccessKeyFrom string
AccessKeyId string `json:"access_key_id" yaml:"access_key_id"`
AccessKeySecret string `json:"access_key_secret" yaml:"access_key_secret"`
AccessKeyFrom string `json:"access_key_from" yaml:"access_key_from"`
}
type AccessKeyCredential struct {
AccessKeyId string
AccessKeySecret string
AccessKeyFrom string
AccessKeyId string `json:"access_key_id" yaml:"access_key_id"`
AccessKeySecret string `json:"access_key_secret" yaml:"access_key_secret"`
AccessKeyFrom string `json:"access_key_from" yaml:"access_key_from"`
}
func (baseCred *BaseCredential) ToAccessKeyCredential() *AccessKeyCredential {

View File

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