s3

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrS3          = errors.New("s3 error")
	ErrMissingETag = fmt.Errorf("%w: missing ETag", ErrS3)
)

Functions

func ExtractParamsFromQK added in v0.97.0

func ExtractParamsFromQK(qk block.QualifiedKey) (string, string)

func LoadConfig added in v0.110.0

func LoadConfig(ctx context.Context, params params.S3) (aws.Config, error)

func WithClientParams added in v0.110.0

func WithClientParams(params params.S3) func(options *s3.Options)

func WithDisablePreSigned added in v0.94.0

func WithDisablePreSigned(b bool) func(a *Adapter)

func WithDisablePreSignedMultipart added in v1.7.0

func WithDisablePreSignedMultipart(b bool) func(a *Adapter)

func WithDisablePreSignedUI added in v0.97.0

func WithDisablePreSignedUI(b bool) func(a *Adapter)

func WithDiscoverBucketRegion added in v0.55.0

func WithDiscoverBucketRegion(b bool) func(a *Adapter)

func WithPreSignedExpiry added in v0.92.0

func WithPreSignedExpiry(v time.Duration) func(a *Adapter)

func WithServerSideEncryption added in v0.87.0

func WithServerSideEncryption(s string) func(a *Adapter)

func WithServerSideEncryptionKmsKeyID added in v0.87.0

func WithServerSideEncryptionKmsKeyID(s string) func(a *Adapter)

func WithStatsCollector added in v0.48.0

func WithStatsCollector(s stats.Collector) func(a *Adapter)

Types

type Adapter

type Adapter struct {
	ServerSideEncryption         string
	ServerSideEncryptionKmsKeyID string
	// contains filtered or unexported fields
}

func NewAdapter

func NewAdapter(ctx context.Context, params params.S3, opts ...AdapterOption) (*Adapter, error)

func (*Adapter) AbortMultiPartUpload

func (a *Adapter) AbortMultiPartUpload(ctx context.Context, obj block.ObjectPointer, uploadID string) error

func (*Adapter) BlockstoreMetadata added in v1.26.0

func (a *Adapter) BlockstoreMetadata(ctx context.Context) (*block.BlockstoreMetadata, error)

func (*Adapter) BlockstoreType

func (a *Adapter) BlockstoreType() string

func (*Adapter) CompleteMultiPartUpload

func (a *Adapter) CompleteMultiPartUpload(ctx context.Context, obj block.ObjectPointer, uploadID string, multipartList *block.MultipartUploadCompletion) (*block.CompleteMultiPartUploadResponse, error)

func (*Adapter) Copy

func (a *Adapter) Copy(ctx context.Context, sourceObj, destinationObj block.ObjectPointer) error

func (*Adapter) Exists

func (a *Adapter) Exists(ctx context.Context, obj block.ObjectPointer) (bool, error)

func (*Adapter) Get

func (*Adapter) GetPreSignedURL added in v0.90.0

func (a *Adapter) GetPreSignedURL(ctx context.Context, obj block.ObjectPointer, mode block.PreSignMode) (string, time.Time, error)

func (*Adapter) GetPresignUploadPartURL added in v1.7.0

func (a *Adapter) GetPresignUploadPartURL(ctx context.Context, obj block.ObjectPointer, uploadID string, partNumber int) (string, error)

func (*Adapter) GetProperties

func (a *Adapter) GetProperties(ctx context.Context, obj block.ObjectPointer) (block.Properties, error)

func (*Adapter) GetRange

func (a *Adapter) GetRange(ctx context.Context, obj block.ObjectPointer, startPosition int64, endPosition int64) (io.ReadCloser, error)

func (*Adapter) GetRegion added in v1.26.0

func (a *Adapter) GetRegion(ctx context.Context, storageNamespace string) (string, error)

func (*Adapter) GetStorageNamespaceInfo

func (a *Adapter) GetStorageNamespaceInfo() block.StorageNamespaceInfo

func (*Adapter) GetWalker added in v0.97.0

func (a *Adapter) GetWalker(uri *url.URL) (block.Walker, error)

func (*Adapter) ListParts added in v1.19.0

func (a *Adapter) ListParts(ctx context.Context, obj block.ObjectPointer, uploadID string, opts block.ListPartsOpts) (*block.ListPartsResponse, error)

func (*Adapter) Put

func (a *Adapter) Put(ctx context.Context, obj block.ObjectPointer, sizeBytes int64, reader io.Reader, opts block.PutOpts) error

func (*Adapter) Remove

func (a *Adapter) Remove(ctx context.Context, obj block.ObjectPointer) error

func (*Adapter) ResolveNamespace added in v0.97.0

func (a *Adapter) ResolveNamespace(storageNamespace, key string, identifierType block.IdentifierType) (block.QualifiedKey, error)

func (*Adapter) RuntimeStats added in v0.41.1

func (a *Adapter) RuntimeStats() map[string]string

func (*Adapter) UploadCopyPart

func (a *Adapter) UploadCopyPart(ctx context.Context, sourceObj, destinationObj block.ObjectPointer, uploadID string, partNumber int) (*block.UploadPartResponse, error)

func (*Adapter) UploadCopyPartRange

func (a *Adapter) UploadCopyPartRange(ctx context.Context, sourceObj, destinationObj block.ObjectPointer, uploadID string, partNumber int, startPosition, endPosition int64) (*block.UploadPartResponse, error)

func (*Adapter) UploadPart

func (a *Adapter) UploadPart(ctx context.Context, obj block.ObjectPointer, sizeBytes int64, reader io.Reader, uploadID string, partNumber int) (*block.UploadPartResponse, error)

type AdapterOption added in v0.87.0

type AdapterOption func(a *Adapter)

type CaptureExpiresPresigner added in v0.110.0

type CaptureExpiresPresigner struct {
	Presigner            s3.HTTPPresignerV4
	CredentialsCanExpire bool
	CredentialsExpireAt  time.Time
}

func (*CaptureExpiresPresigner) PresignHTTP added in v0.110.0

func (c *CaptureExpiresPresigner) PresignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) (url string, signedHeader http.Header, err error)

type ClientCache added in v0.48.0

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

func NewClientCache added in v0.48.0

func NewClientCache(awsConfig aws.Config, params params.S3) *ClientCache

func (*ClientCache) DiscoverBucketRegion added in v0.55.0

func (c *ClientCache) DiscoverBucketRegion(b bool)

func (*ClientCache) Get added in v0.48.0

func (c *ClientCache) Get(ctx context.Context, bucket string) *s3.Client

func (*ClientCache) GetBucketRegionDefault added in v1.26.0

func (c *ClientCache) GetBucketRegionDefault(_ context.Context, _ string) (string, error)

func (*ClientCache) GetBucketRegionFromAWS added in v1.26.0

func (c *ClientCache) GetBucketRegionFromAWS(ctx context.Context, bucket string) (string, error)

func (*ClientCache) GetDefault added in v0.110.0

func (c *ClientCache) GetDefault() *s3.Client

func (*ClientCache) SetClientFactory added in v0.55.0

func (c *ClientCache) SetClientFactory(clientFactory clientFactory)

func (*ClientCache) SetS3RegionGetter added in v0.55.0

func (c *ClientCache) SetS3RegionGetter(s3RegionGetter s3RegionGetter)

func (*ClientCache) SetStatsCollector added in v0.55.0

func (c *ClientCache) SetStatsCollector(statsCollector stats.Collector)

type Walker added in v0.97.0

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

func NewS3Walker added in v0.97.0

func NewS3Walker(client *s3.Client) *Walker

func (*Walker) GetSkippedEntries added in v0.98.0

func (s *Walker) GetSkippedEntries() []block.ObjectStoreEntry

func (*Walker) Marker added in v0.97.0

func (s *Walker) Marker() block.Mark

func (*Walker) Walk added in v0.97.0

func (s *Walker) Walk(ctx context.Context, storageURI *url.URL, op block.WalkOptions, walkFn func(e block.ObjectStoreEntry) error) error

Jump to

Keyboard shortcuts

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