s3

package
v0.0.0-...-285c02a Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MaxListKeys = 10000

MaxListKeys is the maximum number of keys to be listed in the ListObjects method of the Bucket type.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	// contains filtered or unexported fields
}

Bucket represents a container for storing objects.

name is the name of the bucket.

log is a logger used for logging.

cli is an S3 client for interacting with the AWS S3 service.

objectQueue is a queue of objects.

errorsCh is a channel used for sending and receiving errors.

func New

func New(log *wlog.Logger, cfg *config.S3) *Bucket

func (*Bucket) DequeueObjectPool

func (b *Bucket) DequeueObjectPool()

func (*Bucket) DownloadObject

func (b *Bucket) DownloadObject(ctx context.Context, key, filepath string) error

func (*Bucket) EnqueueObjectPool

func (b *Bucket) EnqueueObjectPool(obj string)

func (*Bucket) HeadObject

func (b *Bucket) HeadObject(ctx context.Context, key string) (*s3.HeadObjectOutput, error)

func (*Bucket) ListObjects

func (b *Bucket) ListObjects(ctx context.Context, key string, lastKey string) error

ListObjects lists the objects in a bucket.

func (*Bucket) ObjectPool

func (b *Bucket) ObjectPool() chan string

func (*Bucket) ReadObject

func (b *Bucket) ReadObject(ctx context.Context, key string) ([]byte, error)

ReadObject gets an object from a bucket and stores it in a local file.

Jump to

Keyboard shortcuts

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