Documentation ¶
Overview ¶
Package stsiface provides an interface to enable mocking the STS service client for testing your code.
It is important to note that this interface will have breaking changes when the service model is updated and adds new API operations, paginators, and waiters.
Index ¶
- Constants
- type AssumeRoleInput
- func (s AssumeRoleInput) GoString() string
- func (s *AssumeRoleInput) SetDurationSeconds(v int32) *AssumeRoleInput
- func (s *AssumeRoleInput) SetPolicy(v string) *AssumeRoleInput
- func (s *AssumeRoleInput) SetRoleSessionName(v string) *AssumeRoleInput
- func (s *AssumeRoleInput) SetRoleTrn(v string) *AssumeRoleInput
- func (s *AssumeRoleInput) SetTags(v []*TagForAssumeRoleInput) *AssumeRoleInput
- func (s AssumeRoleInput) String() string
- func (s *AssumeRoleInput) Validate() error
- type AssumeRoleOutput
- type AssumedRoleUserForAssumeRoleOutput
- func (s AssumedRoleUserForAssumeRoleOutput) GoString() string
- func (s *AssumedRoleUserForAssumeRoleOutput) SetAssumedRoleId(v string) *AssumedRoleUserForAssumeRoleOutput
- func (s *AssumedRoleUserForAssumeRoleOutput) SetTrn(v string) *AssumedRoleUserForAssumeRoleOutput
- func (s AssumedRoleUserForAssumeRoleOutput) String() string
- type CredentialsForAssumeRoleOutput
- func (s CredentialsForAssumeRoleOutput) GoString() string
- func (s *CredentialsForAssumeRoleOutput) SetAccessKeyId(v string) *CredentialsForAssumeRoleOutput
- func (s *CredentialsForAssumeRoleOutput) SetCurrentTime(v string) *CredentialsForAssumeRoleOutput
- func (s *CredentialsForAssumeRoleOutput) SetExpiredTime(v string) *CredentialsForAssumeRoleOutput
- func (s *CredentialsForAssumeRoleOutput) SetSecretAccessKey(v string) *CredentialsForAssumeRoleOutput
- func (s *CredentialsForAssumeRoleOutput) SetSessionToken(v string) *CredentialsForAssumeRoleOutput
- func (s CredentialsForAssumeRoleOutput) String() string
- type STS
- func (c *STS) AssumeRole(input *AssumeRoleInput) (*AssumeRoleOutput, error)
- func (c *STS) AssumeRoleCommon(input *map[string]interface{}) (*map[string]interface{}, error)
- func (c *STS) AssumeRoleCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{})
- func (c *STS) AssumeRoleCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error)
- func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, output *AssumeRoleOutput)
- func (c *STS) AssumeRoleWithContext(ctx volcengine.Context, input *AssumeRoleInput, opts ...request.Option) (*AssumeRoleOutput, error)
- type STSAPI
- type TagForAssumeRoleInput
Constants ¶
const ( ServiceName = "sts" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. ServiceID = "sts" // ServiceID is a unique identifer of a specific service. )
Service information constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssumeRoleInput ¶
type AssumeRoleInput struct { DurationSeconds *int32 `type:"int32"` Policy *string `type:"string"` // RoleSessionName is a required field RoleSessionName *string `type:"string" required:"true"` // RoleTrn is a required field RoleTrn *string `type:"string" required:"true"` Tags []*TagForAssumeRoleInput `type:"list"` // contains filtered or unexported fields }
func (AssumeRoleInput) GoString ¶
func (s AssumeRoleInput) GoString() string
GoString returns the string representation
func (*AssumeRoleInput) SetDurationSeconds ¶
func (s *AssumeRoleInput) SetDurationSeconds(v int32) *AssumeRoleInput
SetDurationSeconds sets the DurationSeconds field's value.
func (*AssumeRoleInput) SetPolicy ¶
func (s *AssumeRoleInput) SetPolicy(v string) *AssumeRoleInput
SetPolicy sets the Policy field's value.
func (*AssumeRoleInput) SetRoleSessionName ¶
func (s *AssumeRoleInput) SetRoleSessionName(v string) *AssumeRoleInput
SetRoleSessionName sets the RoleSessionName field's value.
func (*AssumeRoleInput) SetRoleTrn ¶
func (s *AssumeRoleInput) SetRoleTrn(v string) *AssumeRoleInput
SetRoleTrn sets the RoleTrn field's value.
func (*AssumeRoleInput) SetTags ¶
func (s *AssumeRoleInput) SetTags(v []*TagForAssumeRoleInput) *AssumeRoleInput
SetTags sets the Tags field's value.
func (AssumeRoleInput) String ¶
func (s AssumeRoleInput) String() string
String returns the string representation
func (*AssumeRoleInput) Validate ¶
func (s *AssumeRoleInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type AssumeRoleOutput ¶
type AssumeRoleOutput struct { Metadata *response.ResponseMetadata AssumedRoleUser *AssumedRoleUserForAssumeRoleOutput `type:"structure"` Credentials *CredentialsForAssumeRoleOutput `type:"structure"` // contains filtered or unexported fields }
func (AssumeRoleOutput) GoString ¶
func (s AssumeRoleOutput) GoString() string
GoString returns the string representation
func (*AssumeRoleOutput) SetAssumedRoleUser ¶
func (s *AssumeRoleOutput) SetAssumedRoleUser(v *AssumedRoleUserForAssumeRoleOutput) *AssumeRoleOutput
SetAssumedRoleUser sets the AssumedRoleUser field's value.
func (*AssumeRoleOutput) SetCredentials ¶
func (s *AssumeRoleOutput) SetCredentials(v *CredentialsForAssumeRoleOutput) *AssumeRoleOutput
SetCredentials sets the Credentials field's value.
func (AssumeRoleOutput) String ¶
func (s AssumeRoleOutput) String() string
String returns the string representation
type AssumedRoleUserForAssumeRoleOutput ¶
type AssumedRoleUserForAssumeRoleOutput struct { AssumedRoleId *string `type:"string"` Trn *string `type:"string"` // contains filtered or unexported fields }
func (AssumedRoleUserForAssumeRoleOutput) GoString ¶
func (s AssumedRoleUserForAssumeRoleOutput) GoString() string
GoString returns the string representation
func (*AssumedRoleUserForAssumeRoleOutput) SetAssumedRoleId ¶
func (s *AssumedRoleUserForAssumeRoleOutput) SetAssumedRoleId(v string) *AssumedRoleUserForAssumeRoleOutput
SetAssumedRoleId sets the AssumedRoleId field's value.
func (*AssumedRoleUserForAssumeRoleOutput) SetTrn ¶
func (s *AssumedRoleUserForAssumeRoleOutput) SetTrn(v string) *AssumedRoleUserForAssumeRoleOutput
SetTrn sets the Trn field's value.
func (AssumedRoleUserForAssumeRoleOutput) String ¶
func (s AssumedRoleUserForAssumeRoleOutput) String() string
String returns the string representation
type CredentialsForAssumeRoleOutput ¶
type CredentialsForAssumeRoleOutput struct { AccessKeyId *string `type:"string"` CurrentTime *string `type:"string"` ExpiredTime *string `type:"string"` SecretAccessKey *string `type:"string"` SessionToken *string `type:"string"` // contains filtered or unexported fields }
func (CredentialsForAssumeRoleOutput) GoString ¶
func (s CredentialsForAssumeRoleOutput) GoString() string
GoString returns the string representation
func (*CredentialsForAssumeRoleOutput) SetAccessKeyId ¶
func (s *CredentialsForAssumeRoleOutput) SetAccessKeyId(v string) *CredentialsForAssumeRoleOutput
SetAccessKeyId sets the AccessKeyId field's value.
func (*CredentialsForAssumeRoleOutput) SetCurrentTime ¶
func (s *CredentialsForAssumeRoleOutput) SetCurrentTime(v string) *CredentialsForAssumeRoleOutput
SetCurrentTime sets the CurrentTime field's value.
func (*CredentialsForAssumeRoleOutput) SetExpiredTime ¶
func (s *CredentialsForAssumeRoleOutput) SetExpiredTime(v string) *CredentialsForAssumeRoleOutput
SetExpiredTime sets the ExpiredTime field's value.
func (*CredentialsForAssumeRoleOutput) SetSecretAccessKey ¶
func (s *CredentialsForAssumeRoleOutput) SetSecretAccessKey(v string) *CredentialsForAssumeRoleOutput
SetSecretAccessKey sets the SecretAccessKey field's value.
func (*CredentialsForAssumeRoleOutput) SetSessionToken ¶
func (s *CredentialsForAssumeRoleOutput) SetSessionToken(v string) *CredentialsForAssumeRoleOutput
SetSessionToken sets the SessionToken field's value.
func (CredentialsForAssumeRoleOutput) String ¶
func (s CredentialsForAssumeRoleOutput) String() string
String returns the string representation
type STS ¶
STS provides the API operation methods for making requests to STS. See this package's package overview docs for details on the service.
STS methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.
func New ¶
func New(p client.ConfigProvider, cfgs ...*volcengine.Config) *STS
New create int can support ssl or region locate set
func (*STS) AssumeRole ¶
func (c *STS) AssumeRole(input *AssumeRoleInput) (*AssumeRoleOutput, error)
AssumeRole API operation for STS.
Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions with volcengineerr.Error's Code and Message methods to get detailed information about the error.
See the VOLCENGINE API reference guide for STS's API operation AssumeRole for usage and error information.
func (*STS) AssumeRoleCommon ¶
AssumeRoleCommon API operation for STS.
Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions with volcengineerr.Error's Code and Message methods to get detailed information about the error.
See the VOLCENGINE API reference guide for STS's API operation AssumeRoleCommon for usage and error information.
func (*STS) AssumeRoleCommonRequest ¶
func (c *STS) AssumeRoleCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{})
AssumeRoleCommonRequest generates a "volcengine/request.Request" representing the client's request for the AssumeRoleCommon operation. The "output" return value will be populated with the AssumeRoleCommon request's response once the request completes successfully.
Use "Send" method on the returned AssumeRoleCommon Request to send the API call to the service. the "output" return value is not valid until after AssumeRoleCommon Send returns without error.
See AssumeRoleCommon for more information on using the AssumeRoleCommon API call, and error handling.
// Example sending a request using the AssumeRoleCommonRequest method. req, resp := client.AssumeRoleCommonRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*STS) AssumeRoleCommonWithContext ¶
func (c *STS) AssumeRoleCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error)
AssumeRoleCommonWithContext is the same as AssumeRoleCommon with the addition of the ability to pass a context and additional request options.
See AssumeRoleCommon for details on how to use this API operation.
The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.
func (*STS) AssumeRoleRequest ¶
func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, output *AssumeRoleOutput)
AssumeRoleRequest generates a "volcengine/request.Request" representing the client's request for the AssumeRole operation. The "output" return value will be populated with the AssumeRoleCommon request's response once the request completes successfully.
Use "Send" method on the returned AssumeRoleCommon Request to send the API call to the service. the "output" return value is not valid until after AssumeRoleCommon Send returns without error.
See AssumeRole for more information on using the AssumeRole API call, and error handling.
// Example sending a request using the AssumeRoleRequest method. req, resp := client.AssumeRoleRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
func (*STS) AssumeRoleWithContext ¶
func (c *STS) AssumeRoleWithContext(ctx volcengine.Context, input *AssumeRoleInput, opts ...request.Option) (*AssumeRoleOutput, error)
AssumeRoleWithContext is the same as AssumeRole with the addition of the ability to pass a context and additional request options.
See AssumeRole for details on how to use this API operation.
The context must be non-nil and will be used for request cancellation. Ifthe context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.
type STSAPI ¶
type STSAPI interface { AssumeRoleCommon(*map[string]interface{}) (*map[string]interface{}, error) AssumeRoleCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) AssumeRoleCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) AssumeRole(*AssumeRoleInput) (*AssumeRoleOutput, error) AssumeRoleWithContext(volcengine.Context, *AssumeRoleInput, ...request.Option) (*AssumeRoleOutput, error) AssumeRoleRequest(*AssumeRoleInput) (*request.Request, *AssumeRoleOutput) }
STSAPI provides an interface to enable mocking the sts.STS service client's API operation,
// volcengine sdk func uses an SDK service client to make a request to // STS. func myFunc(svc STSAPI) bool { // Make svc.AssumeRole request } func main() { sess := session.New() svc := sts.New(sess) myFunc(svc) }
type TagForAssumeRoleInput ¶
type TagForAssumeRoleInput struct { Key *string `type:"string"` Value *string `type:"string"` // contains filtered or unexported fields }
func (TagForAssumeRoleInput) GoString ¶
func (s TagForAssumeRoleInput) GoString() string
GoString returns the string representation
func (*TagForAssumeRoleInput) SetKey ¶
func (s *TagForAssumeRoleInput) SetKey(v string) *TagForAssumeRoleInput
SetKey sets the Key field's value.
func (*TagForAssumeRoleInput) SetValue ¶
func (s *TagForAssumeRoleInput) SetValue(v string) *TagForAssumeRoleInput
SetValue sets the Value field's value.
func (TagForAssumeRoleInput) String ¶
func (s TagForAssumeRoleInput) String() string
String returns the string representation