awss3

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFile added in v0.2.2

func DownloadFile(ctx context.Context, api GetObjectAPI, bucketName string, objectKey string) ([]byte, error)

DownloadFile downloads file from S3 and returns it as a byte slice

func DownloadFileStream added in v1.0.1

func DownloadFileStream(ctx context.Context, api GetObjectAPI, bucketName string, objectKey string) (io.ReadCloser, error)

DownloadFileStream downloads file from S3 and returns the io.ReadCloser. This must be closed by the callee function!

func DownloadLargeFile added in v0.2.2

func DownloadLargeFile(ctx context.Context, api GetObjectAPI, bucketName string, objectKey string) ([]byte, error)

DownloadFileLarge downloads file from S3 using download manager and returns it as a byte slice

func NewClient added in v0.3.0

func NewClient(useTracing bool) *s3.Client

Types

type GetObjectAPI added in v0.2.2

type GetObjectAPI interface {
	GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
}

type ListObjectsV2API

type ListObjectsV2API interface {
	ListObjectsV2(ctx context.Context,
		params *s3.ListObjectsV2Input,
		optFns ...func(*s3.Options)) (*s3.ListObjectsV2Output, error)
}

type S3File

type S3File struct {
	CreatedAt time.Time
	Name      string
}

func ListBucketObjects

func ListBucketObjects(ctx context.Context, client ListObjectsV2API, bucketName string, prefix string) ([]S3File, error)

Jump to

Keyboard shortcuts

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