s3

package
v0.0.0-...-88587b8 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Retryer

type Retryer struct {
	// RetryCnt is the number of max retries that will be performed.
	// By default, this is zero.
	RetryCnt uint

	// RetryDelay is the minimum retry delay after which retry will be performed.
	// If not set, the value is 0ns.
	RetryDelay time.Duration
}

Retryer implements basic retry logic You can implement the request.Retryer interface.

func (Retryer) MaxRetries

func (d Retryer) MaxRetries() int

MaxRetries returns the number of maximum returns the service will use to make an individual API request.

func (Retryer) RetryRules

func (d Retryer) RetryRules(r *request.Request) time.Duration

RetryRules returns the delay duration before retrying this request again

func (Retryer) ShouldRetry

func (d Retryer) ShouldRetry(r *request.Request) bool

ShouldRetry returns true if the request should be retried.

type S3Storage

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

S3Storage configuration.

func NewS3Storage

func NewS3Storage(awsNoSign bool, awsAccessKey, awsSecretKey, awsToken, awsRegion, endpoint, bucketName, prefix string, keysPerReq int64, retryCnt uint, retryDelay time.Duration, skipSSLVerify bool) *S3Storage

NewS3Storage return new configured S3 storage.

You should always create new storage with this constructor.

func (*S3Storage) DeleteObject

func (st *S3Storage) DeleteObject(obj *storage.Object) error

DeleteObject remove object from S3.

func (*S3Storage) GetObjectACL

func (st *S3Storage) GetObjectACL(obj *storage.Object) error

GetObjectACL read object ACL from S3.

func (*S3Storage) GetObjectContent

func (st *S3Storage) GetObjectContent(obj *storage.Object) error

GetObjectContent read object content and metadata from S3.

func (*S3Storage) GetObjectMeta

func (st *S3Storage) GetObjectMeta(obj *storage.Object) error

GetObjectMeta update object metadata from S3.

func (*S3Storage) List

func (st *S3Storage) List(output chan<- *storage.Object) error

List S3 bucket and send founded objects to chan.

func (*S3Storage) PutObject

func (st *S3Storage) PutObject(obj *storage.Object) error

PutObject saves object to S3. PutObject ignore VersionId, it always save object as latest version.

func (*S3Storage) WithContext

func (st *S3Storage) WithContext(ctx context.Context)

WithContext add's context to storage.

func (*S3Storage) WithRateLimit

func (st *S3Storage) WithRateLimit(limit int) error

WithRateLimit set rate limit (bytes/sec) for storage.

Jump to

Keyboard shortcuts

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