mirror of
https://github.com/nabbar/golib.git
synced 2025-10-05 07:46:56 +08:00
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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user