sts

package
v1.0.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultRegion          = base.RegionApSingapore
	ServiceVersion20180101 = "2018-01-01"
	ServiceName            = "sts"
)

Variables

View Source
var (
	ServiceInfo = &base.ServiceInfo{
		Timeout: 5 * time.Second,
		Host:    "open.byteplusapi.com",
		Header: http.Header{
			"Accept": []string{"application/json"},
		},
	}

	ApiInfoList = map[string]*base.ApiInfo{
		"AssumeRole": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"AssumeRole"},
				"Version": []string{ServiceVersion20180101},
			},
		},
	}
)
View Source
var DefaultInstance = NewInstance()

DefaultInstance 默认的实例

Functions

This section is empty.

Types

type AssumeRoleRequest

type AssumeRoleRequest struct {
	DurationSeconds int
	Policy          string
	RoleTrn         string
	RoleSessionName string
}

type AssumeRoleResp

type AssumeRoleResp struct {
	ResponseMetadata base.ResponseMetadata
	Result           *AssumeRoleResult `json:",omitempty"`
}

AssumeRole

type AssumeRoleResult

type AssumeRoleResult struct {
	Credentials     *Credentials
	AssumedRoleUser *AssumeRoleUser
}

type AssumeRoleUser

type AssumeRoleUser struct {
	Trn           string
	AssumedRoleId string
}

type Credentials

type Credentials struct {
	CurrentTime     string
	ExpiredTime     string
	AccessKeyId     string
	SecretAccessKey string
	SessionToken    string
}

type STS

type STS struct {
	Client *base.Client
}

IAM .

func NewInstance

func NewInstance() *STS

NewInstance 创建一个实例

func (*STS) AssumeRole

func (p *STS) AssumeRole(req *AssumeRoleRequest) (*AssumeRoleResp, int, error)

func (*STS) GetAPIInfo

func (p *STS) GetAPIInfo(api string) *base.ApiInfo

GetAPIInfo interface

func (*STS) GetServiceInfo

func (p *STS) GetServiceInfo() *base.ServiceInfo

GetServiceInfo interface

func (*STS) SetHost

func (p *STS) SetHost(host string)

SetHost .

func (*STS) SetRegion

func (p *STS) SetRegion(region string)

SetHost .

func (*STS) SetSchema

func (p *STS) SetSchema(schema string)

SetSchema .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL