s3

package
v5.0.0-alpha5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputePartSize

func ComputePartSize(fileSize, defaultPartSize, maxNumberOfParts int64) (partSize int64, er error)

func LoadConfig

func LoadConfig(ctx context.Context, sdc *cellsSdk.SdkConfig, options ...interface{}) (aws.Config, error)

LoadConfig prepares a valid S3 configuration to create a new S3 client. It returns an error if the passed option are not one of the supported type that are: cellsSdk.HttpClientOption, cellsSdk.TransportOption, cellsSdk.RoundTripOption, cellsSdk.AwsConfigOption, cellsSdk.CredentialProviderOption

func NewClientFromConfig

func NewClientFromConfig(cfg aws.Config, endpoint string) *s3.Client

NewClientFromConfig is a helper function to create a fully configured S3 client easily. It sets the passed endpoint and wraps the call to AWS SDK S3 default method.

func NewCredentialsProvider

func NewCredentialsProvider(sdc *cellssdk.SdkConfig, options ...interface{}) (aws.CredentialsProvider, error)

func WithCellsConfigStore

func WithCellsConfigStore(store cellssdk.ConfigRefresher) cellssdk.CredentialProviderOption

WithCellsConfigStore is the entry point to provide an external store that exposes a method to refresh and store credentials and become then the unique source of truth to retrieve current credentials.

func WithCustomRetry

func WithCustomRetry(maxAttempts int, maxBackoffDelay time.Duration, extraErrorCodes ...string) cellssdk.AwsConfigOption

WithCustomRetry is a helper function that constructs a valid AwsConfigOption to fine tune the retry strategy after the transfer of a single part has failed.

maxAttempts is the maximum number of times an operation will be retried before giving up. It must be a positive integer, where 1 means only one attempt will be made (no retries) and 0 means it will retry indefinitely.

maxBackoffDelay specifies the maximum amount of time to wait between retry attempts. At the SDK level, we use an exponential backoff strategy with jitter (that introduces randomness in the backoff strategy), so that we wait exponentially longer after each failed attempts but no more than the max backoff delay.

extraErrorCodes is a variadic parameter that allows specifying additional error codes that should trigger a retry. These are in addition to any error codes that the AWS SDK already considers retryable.

func WithLogger

func WithLogger(writer io.Writer, logMode aws.ClientLogMode) cellssdk.AwsConfigOption

WithLogger is a helper function to construct a valid AwsConfigOption to define and configure the logging strategy that will be used by the AWS SDK when performing file transfers.

func WithRegion

func WithRegion(region string) cellssdk.AwsConfigOption

WithRegion is a helper function to define a specific Region when talking with S3 remote server. This is usually useless when remote server is Cells.

Types

type CallbackTransferProvider

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

CallbackTransferProvider provides access to the real transfer process when using the AWS S3 upload manager, e.g. to get more logs

func NewCallbackTransferProvider

func NewCallbackTransferProvider(fileName string, fileSize, partSize int64) *CallbackTransferProvider

NewCallbackTransferProvider creates a new instance.

func (*CallbackTransferProvider) GetWriteTo

func (m *CallbackTransferProvider) GetWriteTo(seeker io.ReadSeeker) (r manager.ReadSeekerWriteTo, cleanup func())

GetWriteTo is called by the AWS SDK for each part to create a new instance of the wrapper.

type LegacyCredentialsProvider

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

func (*LegacyCredentialsProvider) Retrieve

type OAuthCredentialsProvider

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

func (*OAuthCredentialsProvider) Retrieve

func (*OAuthCredentialsProvider) SetConfigRefresher

func (ocp *OAuthCredentialsProvider) SetConfigRefresher(store cellssdk.ConfigRefresher)

type PatCredentialsProvider

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

func (*PatCredentialsProvider) Retrieve

Jump to

Keyboard shortcuts

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