Documentation ¶
Overview ¶
The interfaces are here to make the callers of these API's testable, giving us the ability to mock them. At the time of writing github.com/aws/aws-sdk-go-v2 does not provide interfaces that can be mocked. Add new function signatures as necessary.
Index ¶
Constants ¶
const (
Name = "datalift.service.aws"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertError ¶
Use error handling techniques outlined in https://aws.github.io/aws-sdk-go-v2/docs/handling-errors/ to extract embedded HTTP status information and error messages from AWS SDK errors and create the corresponding gRPC status.
Types ¶
type Client ¶
type Client interface { S3GetBucketPolicy(ctx context.Context, account, region, bucket, accountID string) (*s3.GetBucketPolicyOutput, error) S3StreamingGet(ctx context.Context, account, region, bucket, key string) (io.ReadCloser, error) GetCallerIdentity(ctx context.Context, account, region string) (*sts.GetCallerIdentityOutput, error) SimulateCustomPolicy(ctx context.Context, account, region string, customPolicySimulatorParams *iam.SimulateCustomPolicyInput) (*iam.SimulateCustomPolicyOutput, error) Accounts() []string AccountsAndRegions() map[string][]string GetAccountsInRegion(region string) []string GetPrimaryAccountAlias() string Regions() []string GetDirectClient(account string, region string) (DirectClient, error) }
type DirectClient ¶
type DirectClient interface { Config() *aws.Config IAM() *iam.Client S3() *s3.Client STS() *sts.Client }
DirectClient gives access to the underlying AWS clients from the Golang SDK. This allows arbitrary feature development on top of AWS from other services and modules without having to contribute to the upstream interface. Using these clients will make mocking extremely difficult since it returns the AWS SDK's struct types and not an interface that can be substituted for. It is recommended following initial development of a feature that you add the calls to a service interface so they can be tested more easily.