bucket

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	S3   s3iface.S3API
	Name *string
}

A Bucket is an S3 bucket which holds properties such as bucket name and SSE things for S3 Bucket.

func New

func New(s s3iface.S3API, name string) *Bucket

New returns Bucket instance with bucket name name.

func (*Bucket) CopyObject

func (b *Bucket) CopyObject(dest, src string, opts ...option.CopyObjectInput) (*s3.CopyObjectOutput, error)

CopyObject wraps CopyObjectWithContext using context.Background.

func (*Bucket) CopyObjectWithContext added in v0.1.7

func (b *Bucket) CopyObjectWithContext(ctx context.Context, dest, src string, opts ...option.CopyObjectInput) (*s3.CopyObjectOutput, error)

CopyObjectWithContext copies an object within the bucket.

func (*Bucket) DeleteObject

func (b *Bucket) DeleteObject(key string) (*s3.DeleteObjectOutput, error)

DeleteObject wraps DeleteObjectWithContext using context.Background.

func (*Bucket) DeleteObjectWithContext added in v0.1.7

func (b *Bucket) DeleteObjectWithContext(ctx context.Context, key string) (*s3.DeleteObjectOutput, error)

DeleteObjectWithContext deletes an object for key.

func (*Bucket) DeleteObjects added in v0.1.3

func (b *Bucket) DeleteObjects(identifiers []*s3.ObjectIdentifier) (*s3.DeleteObjectsOutput, error)

DeleteObjects wraps DeleteObjectsWithContext using context.Background.

func (*Bucket) DeleteObjectsWithContext added in v0.1.7

func (b *Bucket) DeleteObjectsWithContext(ctx context.Context, identifiers []*s3.ObjectIdentifier) (*s3.DeleteObjectsOutput, error)

DeleteObjectsWithContext deletes each object for the given identifiers. A maximum of 1000 objects can be deleted at a time with this method.

func (*Bucket) ExistsObject

func (b *Bucket) ExistsObject(key string, opts ...option.HeadObjectInput) (bool, error)

ExistsObject wraps ExistsObjectWithContext using context.Background.

func (*Bucket) ExistsObjectWithContext added in v0.1.7

func (b *Bucket) ExistsObjectWithContext(ctx context.Context, key string, opts ...option.HeadObjectInput) (bool, error)

ExistsObjectWithContext returns true if key does not exist on bucket.

func (*Bucket) GetObject

func (b *Bucket) GetObject(key string, opts ...option.GetObjectInput) (*s3.GetObjectOutput, error)

GetObject wraps GetObjectWithContext using context.Background.

func (*Bucket) GetObjectReader

func (b *Bucket) GetObjectReader(key string, opts ...option.GetObjectInput) (io.ReadCloser, error)

GetObjectReader wraps GetObjectReaderWithContext using context.Background.

func (*Bucket) GetObjectReaderWithContext added in v0.1.7

func (b *Bucket) GetObjectReaderWithContext(ctx context.Context, key string, opts ...option.GetObjectInput) (io.ReadCloser, error)

GetObjectReaderWithContext returns a reader assosiated with body. A caller of this MUST close the reader when it finishes reading.

func (*Bucket) GetObjectRequest added in v0.1.1

func (b *Bucket) GetObjectRequest(key string, opts ...option.GetObjectInput) (*request.Request, *s3.GetObjectOutput)

GetObjectRequest generates a "aws/request.Request" representing the client's request for the GetObject operation.

func (*Bucket) GetObjectWithContext added in v0.1.7

func (b *Bucket) GetObjectWithContext(ctx context.Context, key string, opts ...option.GetObjectInput) (*s3.GetObjectOutput, error)

GetObjectWithContext returns the s3.GetObjectOutput.

func (*Bucket) HeadObject

func (b *Bucket) HeadObject(key string, opts ...option.HeadObjectInput) (*s3.HeadObjectOutput, error)

HeadObject wraps HeadObjectWithContext using context.Background.

func (*Bucket) HeadObjectWithContext added in v0.1.7

func (b *Bucket) HeadObjectWithContext(ctx context.Context, key string, opts ...option.HeadObjectInput) (*s3.HeadObjectOutput, error)

HeadObjectWithContext retrieves an object metadata for key.

func (*Bucket) ListObjectVersionsPagesWithContext added in v0.1.5

func (b *Bucket) ListObjectVersionsPagesWithContext(
	ctx aws.Context,
	prefix string,
	pageFunc func(*s3.ListObjectVersionsOutput, bool) bool,
	opts ...option.ListObjectVersionsInput,
) error

ListObjectVersionsPagesWithContext will page through all versions of all objects with the given prefix.

func (*Bucket) ListObjects

func (b *Bucket) ListObjects(prefix string, opts ...option.ListObjectsInput) (*s3.ListObjectsOutput, error)

ListObjects wraps ListObjectsWithContext using.

func (*Bucket) ListObjectsV2PagesWithContext added in v0.1.4

func (b *Bucket) ListObjectsV2PagesWithContext(
	ctx aws.Context,
	prefix string,
	pageFunc func(*s3.ListObjectsV2Output, bool) bool,
	opts ...option.ListObjectsV2Input,
) error

ListObjectsV2PagesWithContext will page through objects with the given prefix.

func (*Bucket) ListObjectsWithContext added in v0.1.7

func (b *Bucket) ListObjectsWithContext(ctx context.Context, prefix string, opts ...option.ListObjectsInput) (*s3.ListObjectsOutput, error)

ListObjectsWithContext lists objects that has prefix.

func (*Bucket) PutObject

func (b *Bucket) PutObject(key string, rs io.ReadSeeker, opts ...option.PutObjectInput) (*s3.PutObjectOutput, error)

PutObject puts an object with reading data from reader.

func (*Bucket) PutObjectWithContext added in v0.1.7

func (b *Bucket) PutObjectWithContext(ctx context.Context, key string, rs io.ReadSeeker, opts ...option.PutObjectInput) (*s3.PutObjectOutput, error)

PutObjectWithContext puts an object with reading data from reader.

Directories

Path Synopsis
Package option provides adapters to change a parameter in S3 request.
Package option provides adapters to change a parameter in S3 request.

Jump to

Keyboard shortcuts

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