manager

package
v0.0.0-...-e92691c Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B  = 1         //BYTE
	KB = 1024 * B  //KILOBYTE
	MB = 1000 * KB //MEGABYTE
	GB = 1000 * MB //GIGABYTE
)

BYTES

Variables

This section is empty.

Functions

func NewDownloader

func NewDownloader(svc *s3.S3) *s3manager.Downloader

NewDownloader creates a download manager from the S3 Client and is then customized to chunk downloads by 50MB/chunk

func NewS3

func NewS3(region string) *s3.S3

NewS3 creates an s3 client in the given region

func NewUploader

func NewUploader(svc *s3.S3) *s3manager.Uploader

NewUploader creates an upload manager from the s3 client and is then customized to chunk uploads by 30MB/chunk

Types

type FileManager

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

FileManager handles it all

func NewWithClient

func NewWithClient(svc *s3.S3) *FileManager

NewWithClient creates a file manager from an s3 client

func NewWithRecord

func NewWithRecord(record events.S3EventRecord) *FileManager

NewWithRecord creates a file manager from the s3 event record

func (*FileManager) DownloadToFile

func (fm *FileManager) DownloadToFile(bucket, key string, size int64) (*mem.File, error)

DownloadToFile downloads from S3 to memfile

func (*FileManager) PrimeFile

func (fm *FileManager) PrimeFile(bucket, key string) (*mem.File, error)

PrimeFile returns file with buffer of size ContentLength

func (*FileManager) UploadFile

func (fm *FileManager) UploadFile(bucket, key string, fp *mem.File) error

UploadFile uploads files to S3

Jump to

Keyboard shortcuts

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