Documentation ¶
Index ¶
- func ComputePartSize(fileSize, defaultPartSize, maxNumberOfParts int64) (partSize int64, er error)
- func LoadConfig(ctx context.Context, sdc *cellsSdk.SdkConfig, options ...interface{}) (aws.Config, error)
- func NewClientFromConfig(cfg aws.Config, endpoint string) *s3.Client
- func NewCredentialsProvider(sdc *cellssdk.SdkConfig, options ...interface{}) (aws.CredentialsProvider, error)
- func WithCellsConfigStore(store cellssdk.ConfigRefresher) cellssdk.CredentialProviderOption
- func WithCustomRetry(maxAttempts int, maxBackoffDelay time.Duration, extraErrorCodes ...string) cellssdk.AwsConfigOption
- func WithLogger(writer io.Writer, logMode aws.ClientLogMode) cellssdk.AwsConfigOption
- func WithRegion(region string) cellssdk.AwsConfigOption
- type CallbackTransferProvider
- type LegacyCredentialsProvider
- type OAuthCredentialsProvider
- type PatCredentialsProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputePartSize ¶
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 ¶
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, nbOfParts int, verbose bool) *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 ¶
func (lcp *LegacyCredentialsProvider) Retrieve(ctx context.Context) (aws.Credentials, error)
type OAuthCredentialsProvider ¶
type OAuthCredentialsProvider struct {
// contains filtered or unexported fields
}
func (*OAuthCredentialsProvider) Retrieve ¶
func (ocp *OAuthCredentialsProvider) Retrieve(ctx context.Context) (aws.Credentials, error)
func (*OAuthCredentialsProvider) SetConfigRefresher ¶
func (ocp *OAuthCredentialsProvider) SetConfigRefresher(store cellssdk.ConfigRefresher)
type PatCredentialsProvider ¶
type PatCredentialsProvider struct {
// contains filtered or unexported fields
}
func (*PatCredentialsProvider) Retrieve ¶
func (pcp *PatCredentialsProvider) Retrieve(_ context.Context) (aws.Credentials, error)