Documentation ¶
Overview ¶
Package s3x contains S3 utilities.
Index ¶
- func CreateBucketIfNotExists(ctx context.Context, client *s3.Client, bucket string, ...) error
- func DeleteBucketIfExists(ctx context.Context, client *s3.Client, bucket string, ...) (err error)
- func IgnoreAlreadyExists(err error) error
- func IgnoreNotExists(err error) error
- func IsAlreadyExists(err error) bool
- func IsConflict(err error) bool
- func IsNotExists(err error) bool
- func NewTestClient(t testing.TB) *s3.Client
- type ReadSeeker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBucketIfNotExists ¶
func CreateBucketIfNotExists( ctx context.Context, client *s3.Client, bucket string, onRequest func(any) []func(*s3.Options), ) error
CreateBucketIfNotExists creates an S3 bucket if it does not already exist.
func DeleteBucketIfExists ¶
func DeleteBucketIfExists( ctx context.Context, client *s3.Client, bucket string, onRequest func(any) []func(*s3.Options), ) (err error)
DeleteBucketIfExists deletes an S3 bucket if it exists.
func IgnoreAlreadyExists ¶
IgnoreAlreadyExists returns nil if err is an error that indicates the requested object already exists; otherwise it returns err.
func IgnoreNotExists ¶
IgnoreNotExists returns nil if err is an error that indicates the requested object was not found; otherwise it returns err.
func IsAlreadyExists ¶
IsAlreadyExists returns true if err is an error that indicates the requested object already exists.
func IsConflict ¶
IsConflict returns true if err is an error that indicates an object conflict.
func IsNotExists ¶
IsNotExists returns true if err is an error that indicates the requested object was not found.
Types ¶
type ReadSeeker ¶
type ReadSeeker struct {
// contains filtered or unexported fields
}
ReadSeeker is an io.ReadSeeker that reads from a byte slice.
See https://github.com/aws/aws-sdk-go-v2/issues/1108.
func NewReadSeeker ¶
func NewReadSeeker(data []byte) *ReadSeeker
NewReadSeeker returns a new ReadSeeker that reads from the given byte slice.
func (*ReadSeeker) Read ¶
func (s *ReadSeeker) Read(p []byte) (n int, err error)
Read implements io.Reader.
func (*ReadSeeker) Reset ¶
func (s *ReadSeeker) Reset(data []byte)
Reset resets the reader to read from the given byte slice.