IT with aws client mock

This commit is contained in:
kkb0318
2024-04-09 21:40:09 +09:00
parent 0f3323b2fc
commit d99f64f148
7 changed files with 60 additions and 240 deletions
+4 -4
View File
@@ -29,8 +29,8 @@ type AwsS3API interface {
}
type AwsClient interface {
IamCient() *AwsIamClient
S3Cient(region, bucketName string) *AwsS3Client
IamClient() *AwsIamClient
S3Client(region, bucketName string) *AwsS3Client
}
func NewAwsClientFactory(ctx context.Context) (*AwsClientFactory, error) {
@@ -43,13 +43,13 @@ func NewAwsClientFactory(ctx context.Context) (*AwsClientFactory, error) {
return &AwsClientFactory{config: cfg}, nil
}
func (a *AwsClientFactory) IamCient() *AwsIamClient {
func (a *AwsClientFactory) IamClient() *AwsIamClient {
return &AwsIamClient{
iam.NewFromConfig(a.config),
}
}
func (a *AwsClientFactory) S3Cient(bucketName, region string) *AwsS3Client {
func (a *AwsClientFactory) S3Client(bucketName, region string) *AwsS3Client {
return &AwsS3Client{
s3.NewFromConfig(a.config),
region,