s3

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComposeFolder

func ComposeFolder(prefix string, year, month, day int) string

{prefix}/2006/01/02/

func ComposeKey

func ComposeKey(prefix string, now time.Time, ext string) string

{prefix}/2006/01/02/2006-01-02-15-04-00.png

Types

type APIV2 added in v0.3.0

type APIV2 interface {
	GetObject(context.Context, *s3v2.GetObjectInput, ...func(*s3v2.Options)) (*s3v2.GetObjectOutput, error)
	ListObjectsV2(context.Context, *s3v2.ListObjectsV2Input, ...func(*s3v2.Options)) (*s3v2.ListObjectsV2Output, error)
	PutObject(context.Context, *s3v2.PutObjectInput, ...func(*s3v2.Options)) (*s3v2.PutObjectOutput, error)
}

type ClientV2 added in v0.3.0

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

ClientV2 represents the wrapper of S3 API Client using AWS SDK V2

func NewV2 added in v0.3.0

func NewV2(api APIV2) *ClientV2

NewV2 creates new ClientV2

func (*ClientV2) GetObject added in v0.3.0

func (c *ClientV2) GetObject(ctx context.Context, bucket, key string) ([]byte, error)

GetObject downloads an object from the specified S3 location

func (*ClientV2) ListObjectKeys added in v0.3.0

func (c *ClientV2) ListObjectKeys(ctx context.Context, bucket, folder string) ([]string, error)

ListObjectKeys retrieves the list of keys in the given S3 bucket and folder

func (*ClientV2) Upload added in v0.3.0

func (c *ClientV2) Upload(ctx context.Context, bucket, key string, reader io.ReadSeeker) error

Upload uploads the given stream to the given S3 location

type ListObjectV2Pager added in v0.3.0

type ListObjectV2Pager interface {
	HasMorePages() bool
	NextPage(context.Context, ...func(*s3v2.Options)) (*s3v2.ListObjectsV2Output, error)
}

type ListObjectsV2PagerFactory added in v0.3.0

type ListObjectsV2PagerFactory func(client s3v2.ListObjectsV2APIClient, params *s3v2.ListObjectsV2Input, optFns ...func(*s3v2.ListObjectsV2PaginatorOptions)) ListObjectV2Pager

Jump to

Keyboard shortcuts

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