s3client

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 33 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AwsErrRetry

func AwsErrRetry(err error) bool

func ExtractReqBody

func ExtractReqBody(r *http.Request, body any) error

func ExtractRespBody

func ExtractRespBody(r *http.Response, body any) error

Types

type AWS

type AWS struct {
	*aws_s3.S3
	// contains filtered or unexported fields
}

type Client

type Client interface {
	Config() s3.Storage
	Name() string
	S3() *S3
	AWS() *AWS
	SNS() *sns.Client
	Do(req *http.Request) (*http.Response, bool, error)
	IsOnline() bool
}

type RequestID

type RequestID struct {
	ID       string
	Extended string
}

func GetRequestID

func GetRequestID(resp *http.Response) (RequestID, error)

func MustRequestID

func MustRequestID(resp *http.Response) RequestID

func (RequestID) String

func (r RequestID) String() string

type S3

type S3 struct {
	*mclient.Client
	// contains filtered or unexported fields
}

func (*S3) BucketExists

func (s *S3) BucketExists(ctx context.Context, bucketName string) (bool, error)

func (*S3) GetBucketLifecycle

func (s *S3) GetBucketLifecycle(ctx context.Context, bucketName string) (*lifecycle.Configuration, error)

func (*S3) GetBucketPolicy

func (s *S3) GetBucketPolicy(ctx context.Context, bucketName string) (string, error)

func (*S3) GetBucketTagging

func (s *S3) GetBucketTagging(ctx context.Context, bucketName string) (*tags.Tags, error)

func (*S3) GetBucketVersioning

func (s *S3) GetBucketVersioning(ctx context.Context, bucketName string) (mclient.BucketVersioningConfiguration, error)

func (*S3) GetObjectTagging

func (s *S3) GetObjectTagging(ctx context.Context, bucketName, objectName string, opts mclient.GetObjectTaggingOptions) (*tags.Tags, error)

func (*S3) ListBuckets

func (s *S3) ListBuckets(ctx context.Context) ([]mclient.BucketInfo, error)

func (*S3) ListObjects

func (s *S3) ListObjects(ctx context.Context, bucketName string, opts mclient.ListObjectsOptions) <-chan mclient.ObjectInfo

func (*S3) MakeBucket

func (s *S3) MakeBucket(ctx context.Context, bucketName string, opts mclient.MakeBucketOptions) (err error)

func (*S3) PutObjectTagging

func (s *S3) PutObjectTagging(ctx context.Context, bucketName, objectName string, otags *tags.Tags, opts mclient.PutObjectTaggingOptions) error

func (*S3) RemoveBucket

func (s *S3) RemoveBucket(ctx context.Context, bucketName string) error

func (*S3) RemoveBucketTagging

func (s *S3) RemoveBucketTagging(ctx context.Context, bucketName string) error

func (*S3) RemoveObject

func (s *S3) RemoveObject(ctx context.Context, bucketName, objectName string, opts mclient.RemoveObjectOptions) error

func (*S3) RemoveObjectTagging

func (s *S3) RemoveObjectTagging(ctx context.Context, bucketName, objectName string, opts mclient.RemoveObjectTaggingOptions) error

func (*S3) RemoveObjects

func (s *S3) RemoveObjects(ctx context.Context, bucketName string, objectsCh <-chan mclient.ObjectInfo, opts mclient.RemoveObjectsOptions) <-chan mclient.RemoveObjectError

func (*S3) SetBucketLifecycle

func (s *S3) SetBucketLifecycle(ctx context.Context, bucketName string, config *lifecycle.Configuration) error

func (*S3) SetBucketPolicy

func (s *S3) SetBucketPolicy(ctx context.Context, bucketName, policy string) error

func (*S3) SetBucketTagging

func (s *S3) SetBucketTagging(ctx context.Context, bucketName string, tags *tags.Tags) error

func (*S3) SetBucketVersioning

func (s *S3) SetBucketVersioning(ctx context.Context, bucketName string, config mclient.BucketVersioningConfiguration) error

type Service

type Service interface {
	GetByName(ctx context.Context, storageName string) (Client, error)
}

func New

func New(ctx context.Context, conf *s3.StorageConfig, metricsSvc metrics.S3Service, tp trace.TracerProvider) (Service, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL