Bump to sdk aws go v2 at release v0.26.0...

Bump dependancies
Refactor / Fix aws to work with sdk-aws-go-v2 at release v0.26.0...
This commit is contained in:
Nicolas JUHEL
2020-09-30 13:04:47 +02:00
parent 47dc7f34ae
commit 94f90d7e22
38 changed files with 706 additions and 749 deletions

View File

@@ -3,37 +3,38 @@ package bucket
import (
"context"
"github.com/aws/aws-sdk-go-v2/service/iam"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/nabbar/golib/aws/helper"
"github.com/nabbar/golib/errors"
sdkiam "github.com/aws/aws-sdk-go-v2/service/iam"
sdksss "github.com/aws/aws-sdk-go-v2/service/s3"
sdkstp "github.com/aws/aws-sdk-go-v2/service/s3/types"
libhlp "github.com/nabbar/golib/aws/helper"
ligerr "github.com/nabbar/golib/errors"
)
type client struct {
helper.Helper
iam *iam.Client
s3 *s3.Client
libhlp.Helper
iam *sdkiam.Client
s3 *sdksss.Client
}
type Bucket interface {
Check() errors.Error
Check() ligerr.Error
List() ([]s3.Bucket, errors.Error)
Create() errors.Error
Delete() errors.Error
List() ([]*sdkstp.Bucket, ligerr.Error)
Create() ligerr.Error
Delete() ligerr.Error
//FindObject(pattern string) ([]string, errors.Error)
SetVersioning(state bool) errors.Error
GetVersioning() (string, errors.Error)
SetVersioning(state bool) ligerr.Error
GetVersioning() (string, ligerr.Error)
EnableReplication(srcRoleARN, dstRoleARN, dstBucketName string) errors.Error
DeleteReplication() errors.Error
EnableReplication(srcRoleARN, dstRoleARN, dstBucketName string) ligerr.Error
DeleteReplication() ligerr.Error
}
func New(ctx context.Context, bucket string, iam *iam.Client, s3 *s3.Client) Bucket {
func New(ctx context.Context, bucket string, iam *sdkiam.Client, s3 *sdksss.Client) Bucket {
return &client{
Helper: helper.New(ctx, bucket),
Helper: libhlp.New(ctx, bucket),
iam: iam,
s3: s3,
}