package stsiface
Import Path
github.com/aws/aws-sdk-go/service/sts/stsiface (on go.dev )
Dependency Relation
imports 3 packages , and imported by one package
Package-Level Type Names (only one, which is exported)
/* sort exporteds by: alphabet | popularity */
type STSAPI (interface)
STSAPI provides an interface to enable mocking the
sts.STS service client's API operation,
paginators, and waiters. This make unit testing your code that calls out
to the SDK's service client's calls easier.
The best way to use this interface is so the SDK's service client's calls
can be stubbed out for unit testing your code with the SDK without needing
to inject custom request handlers into the SDK's request pipeline.
// myFunc uses an SDK service client to make a request to
// AWS Security Token Service.
func myFunc(svc stsiface.STSAPI) bool {
// Make svc.AssumeRole request
}
func main() {
sess := session.New()
svc := sts.New(sess)
myFunc(svc)
}
In your _test.go file:
// Define a mock struct to be used in your unit tests of myFunc.
type mockSTSClient struct {
stsiface.STSAPI
}
func (m *mockSTSClient) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) {
// mock response/functionality
}
func TestMyFunc(t *testing.T) {
// Setup Test
mockSvc := &mockSTSClient{}
myfunc(mockSvc)
// Verify myFunc's functionality
}
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. Its suggested to use the pattern above for testing, or using
tooling to generate mocks to satisfy the interfaces.
Methods (total 24, all are exported )
( T) AssumeRole (*sts .AssumeRoleInput ) (*sts .AssumeRoleOutput , error )
( T) AssumeRoleRequest (*sts .AssumeRoleInput ) (*request .Request , *sts .AssumeRoleOutput )
( T) AssumeRoleWithContext (aws .Context , *sts .AssumeRoleInput , ...request .Option ) (*sts .AssumeRoleOutput , error )
( T) AssumeRoleWithSAML (*sts .AssumeRoleWithSAMLInput ) (*sts .AssumeRoleWithSAMLOutput , error )
( T) AssumeRoleWithSAMLRequest (*sts .AssumeRoleWithSAMLInput ) (*request .Request , *sts .AssumeRoleWithSAMLOutput )
( T) AssumeRoleWithSAMLWithContext (aws .Context , *sts .AssumeRoleWithSAMLInput , ...request .Option ) (*sts .AssumeRoleWithSAMLOutput , error )
( T) AssumeRoleWithWebIdentity (*sts .AssumeRoleWithWebIdentityInput ) (*sts .AssumeRoleWithWebIdentityOutput , error )
( T) AssumeRoleWithWebIdentityRequest (*sts .AssumeRoleWithWebIdentityInput ) (*request .Request , *sts .AssumeRoleWithWebIdentityOutput )
( T) AssumeRoleWithWebIdentityWithContext (aws .Context , *sts .AssumeRoleWithWebIdentityInput , ...request .Option ) (*sts .AssumeRoleWithWebIdentityOutput , error )
( T) DecodeAuthorizationMessage (*sts .DecodeAuthorizationMessageInput ) (*sts .DecodeAuthorizationMessageOutput , error )
( T) DecodeAuthorizationMessageRequest (*sts .DecodeAuthorizationMessageInput ) (*request .Request , *sts .DecodeAuthorizationMessageOutput )
( T) DecodeAuthorizationMessageWithContext (aws .Context , *sts .DecodeAuthorizationMessageInput , ...request .Option ) (*sts .DecodeAuthorizationMessageOutput , error )
( T) GetAccessKeyInfo (*sts .GetAccessKeyInfoInput ) (*sts .GetAccessKeyInfoOutput , error )
( T) GetAccessKeyInfoRequest (*sts .GetAccessKeyInfoInput ) (*request .Request , *sts .GetAccessKeyInfoOutput )
( T) GetAccessKeyInfoWithContext (aws .Context , *sts .GetAccessKeyInfoInput , ...request .Option ) (*sts .GetAccessKeyInfoOutput , error )
( T) GetCallerIdentity (*sts .GetCallerIdentityInput ) (*sts .GetCallerIdentityOutput , error )
( T) GetCallerIdentityRequest (*sts .GetCallerIdentityInput ) (*request .Request , *sts .GetCallerIdentityOutput )
( T) GetCallerIdentityWithContext (aws .Context , *sts .GetCallerIdentityInput , ...request .Option ) (*sts .GetCallerIdentityOutput , error )
( T) GetFederationToken (*sts .GetFederationTokenInput ) (*sts .GetFederationTokenOutput , error )
( T) GetFederationTokenRequest (*sts .GetFederationTokenInput ) (*request .Request , *sts .GetFederationTokenOutput )
( T) GetFederationTokenWithContext (aws .Context , *sts .GetFederationTokenInput , ...request .Option ) (*sts .GetFederationTokenOutput , error )
( T) GetSessionToken (*sts .GetSessionTokenInput ) (*sts .GetSessionTokenOutput , error )
( T) GetSessionTokenRequest (*sts .GetSessionTokenInput ) (*request .Request , *sts .GetSessionTokenOutput )
( T) GetSessionTokenWithContext (aws .Context , *sts .GetSessionTokenInput , ...request .Option ) (*sts .GetSessionTokenOutput , error )
Implemented By (at least one exported )
*github.com/aws/aws-sdk-go/service/sts.STS
Implements (at least 2, in which 1 are exported )
T : github.com/aws/aws-sdk-go/aws/credentials/stscreds.AssumeRoler
/* at least one unexported ... */ /* at least one unexported: */
T : github.com/aws/aws-sdk-go/aws/credentials/stscreds.assumeRolerWithContext
As Inputs Of (at least 2, both are exported )
func github.com/aws/aws-sdk-go/aws/credentials/stscreds.NewWebIdentityRoleProvider (svc STSAPI , roleARN, roleSessionName, path string ) *stscreds .WebIdentityRoleProvider
func github.com/aws/aws-sdk-go/aws/credentials/stscreds.NewWebIdentityRoleProviderWithToken (svc STSAPI , roleARN, roleSessionName string , tokenFetcher stscreds .TokenFetcher ) *stscreds .WebIdentityRoleProvider
The pages are generated with Golds v0.3.2-preview . (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds .