awsutil

package
v0.0.0-...-1c9e867 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//S3Concurrency parallels parts download limit
	S3Concurrency = 5
	//S3PartSize size of part to download
	S3PartSize = 5 * 1024 * 1024
	//S3PartLeaveError leaves parts to manual resolve errors on uploads
	S3PartLeaveError = true
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomReader

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

CustomReader contains the details of Chunks being downloaded

func (*CustomReader) Read

func (r *CustomReader) Read(p []byte) (int, error)

func (*CustomReader) ReadAt

func (r *CustomReader) ReadAt(p []byte, off int64) (int, error)

func (*CustomReader) Seek

func (r *CustomReader) Seek(offset int64, whence int) (int64, error)

type CustomWriter

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

func (*CustomWriter) Seek

func (r *CustomWriter) Seek(offset int64, whence int) (int64, error)

func (*CustomWriter) Write

func (r *CustomWriter) Write(p []byte) (int, error)

func (*CustomWriter) WriteAt

func (r *CustomWriter) WriteAt(p []byte, off int64) (int, error)

type S3CredProvider

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

func (*S3CredProvider) IsExpired

func (p *S3CredProvider) IsExpired() bool

func (*S3CredProvider) Retrieve

func (p *S3CredProvider) Retrieve() (credentials.Value, error)

type S3ctx

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

func NewAwsCtx

func NewAwsCtx(id, secret, region string, hctx *http.Client) *S3ctx

func (*S3ctx) CompleteUploadedParts

func (s *S3ctx) CompleteUploadedParts(bname, bkey, uploadID string, parts []string) error

CompleteUploadedParts is used to complete the multiple uploaded parts

func (*S3ctx) CreateBucket

func (s *S3ctx) CreateBucket(bname string) error

func (*S3ctx) DeleteBucket

func (s *S3ctx) DeleteBucket(bname string) error

func (*S3ctx) DeleteObject

func (s *S3ctx) DeleteObject(bname, bkey string) error

func (*S3ctx) DownloadFile

func (s *S3ctx) DownloadFile(fname, bname, bkey string,
	objMaxSize int64, doneParts types.DownloadedParts, prgNotify types.StatsNotifChan) (types.DownloadedParts, error)

func (*S3ctx) DownloadFileByChunks

func (s *S3ctx) DownloadFileByChunks(fname, bname, bkey string) (io.ReadCloser, int64, error)

DownloadFileByChunks downloads the file from s3 chunk by chunk and passes it to the caller

func (*S3ctx) GetObjectMD5

func (s *S3ctx) GetObjectMD5(bname, bkey string) (error, string)

func (*S3ctx) GetObjectMetaData

func (s *S3ctx) GetObjectMetaData(bname, bkey string) (int64, string, error)

func (*S3ctx) GetObjectSize

func (s *S3ctx) GetObjectSize(bname, bkey string) (error, int64)

func (*S3ctx) GetObjectURL

func (s *S3ctx) GetObjectURL(bname, bkey string) (error, string)

func (*S3ctx) GetSignedURL

func (s *S3ctx) GetSignedURL(bname, bkey string, duration time.Duration) (string, error)

GetSignedURL is used to generate the URI which can be used to access the resource until the URI expries

func (*S3ctx) IsBucketAvailable

func (s *S3ctx) IsBucketAvailable(bname string) (error, bool)

func (*S3ctx) ListImages

func (s *S3ctx) ListImages(bname string, prgNotify types.StatsNotifChan) ([]string, error)

func (*S3ctx) UploadFile

func (s *S3ctx) UploadFile(fname, bname, bkey string, compression bool, prgNotify types.StatsNotifChan) (string, error)

func (*S3ctx) UploadPart

func (s *S3ctx) UploadPart(bname, bkey string, chunk []byte, partNumber int64, uploadID string) (string, string, error)

UploadPart is used to upload the given chunk of data into the Multipart file

func (*S3ctx) WaitUntilBucketExists

func (s *S3ctx) WaitUntilBucketExists(bname string) bool

func (*S3ctx) WithContext

func (s *S3ctx) WithContext(cancelContext context.Context) *S3ctx

WithContext can be used to pass a context e.g., for cancellation

func (*S3ctx) WithLogger

func (s *S3ctx) WithLogger(logger types.Logger) *S3ctx

WithLogger pass logs to logger

Jump to

Keyboard shortcuts

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