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

@@ -5,33 +5,34 @@ import (
"context"
"io"
"github.com/aws/aws-sdk-go-v2/service/iam"
"github.com/aws/aws-sdk-go-v2/service/s3"
sdkiam "github.com/aws/aws-sdk-go-v2/service/iam"
sdksss "github.com/aws/aws-sdk-go-v2/service/s3"
sdktps "github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/nabbar/golib/aws/helper"
"github.com/nabbar/golib/errors"
)
type client struct {
helper.Helper
iam *iam.Client
s3 *s3.Client
iam *sdkiam.Client
s3 *sdksss.Client
}
type Object interface {
Find(pattern string) ([]string, errors.Error)
Size(object string) (size int64, err errors.Error)
List(continuationToken string) ([]s3.Object, string, int64, errors.Error)
Head(object string) (head map[string]interface{}, meta map[string]string, err errors.Error)
Get(object string) (io.ReadCloser, []io.Closer, errors.Error)
List(continuationToken string) ([]*sdktps.Object, string, int64, errors.Error)
Head(object string) (*sdksss.HeadObjectOutput, errors.Error)
Get(object string) (*sdksss.GetObjectOutput, errors.Error)
Put(object string, body *bytes.Reader) errors.Error
Delete(object string) errors.Error
MultipartPut(object string, body io.Reader) errors.Error
MultipartPutCustom(partSize helper.PartSize, object string, body io.Reader, concurrent int) errors.Error
MultipartPutCustom(partSize helper.PartSize, object string, body io.Reader) errors.Error
}
func New(ctx context.Context, bucket string, iam *iam.Client, s3 *s3.Client) Object {
func New(ctx context.Context, bucket string, iam *sdkiam.Client, s3 *sdksss.Client) Object {
return &client{
Helper: helper.New(ctx, bucket),
iam: iam,