Documentation ¶
Index ¶
- Constants
- type Backend
- func (b *Backend) AbortMultipartUpload(ctx context.Context, opts *types.AbortMultipartUploadOpts) error
- func (b *Backend) CompleteMultipartUpload(ctx context.Context, opts *types.CompleteMultipartUploadOpts) error
- func (b *Backend) CreateMultipartUpload(ctx context.Context, opts *types.CreateMultipartUploadOpts) (*types.CreateMultipartUploadResult, error)
- func (b *Backend) Delete(ctx context.Context, opts *types.DeleteOpts) error
- func (b *Backend) Download(ctx context.Context, opts *types.DownloadOpts) (*types.DownloadResult, error)
- func (b *Backend) GeneratePresignedUploadURL(ctx context.Context, opts *types.GeneratePresignedUploadURLOpts) (*types.GeneratePresignedUploadURLResult, error)
- func (b *Backend) List(ctx context.Context, opts *types.ListOpts) (*types.ListResult, error)
- func (b *Backend) Move(ctx context.Context, opts *types.MoveOpts) error
- func (b *Backend) Stat(ctx context.Context, opts *types.StatOpts) (*types.StatResult, error)
- func (b *Backend) Upload(ctx context.Context, opts *types.UploadOpts) error
- func (b *Backend) UploadPart(ctx context.Context, opts *types.UploadPartOpts) (*types.UploadPartResult, error)
- type Options
Constants ¶
const (
// https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#RESTErrorResponses
ErrCodeNoSuchKey = "NoSuchKey"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct { Bucket string Client *s3.Client Presign *s3.PresignClient Downloader *manager.Downloader Prefix string Uploader *manager.Uploader SSE string UseAccelerate bool }
Backend is a storage backend for S3
func (*Backend) AbortMultipartUpload ¶
func (b *Backend) AbortMultipartUpload(ctx context.Context, opts *types.AbortMultipartUploadOpts) error
AbortMultipartUpload aborts the multipart upload
func (*Backend) CompleteMultipartUpload ¶
func (b *Backend) CompleteMultipartUpload(ctx context.Context, opts *types.CompleteMultipartUploadOpts) error
CompleteMultipartUpload completes a multipart upload
func (*Backend) CreateMultipartUpload ¶
func (b *Backend) CreateMultipartUpload(ctx context.Context, opts *types.CreateMultipartUploadOpts) (*types.CreateMultipartUploadResult, error)
CreateMultipartUpload initiates a multipart upload.
func (*Backend) Download ¶
func (b *Backend) Download(ctx context.Context, opts *types.DownloadOpts) (*types.DownloadResult, error)
Download downloads an object from S3 bucket, at given path
func (*Backend) GeneratePresignedUploadURL ¶
func (b *Backend) GeneratePresignedUploadURL(ctx context.Context, opts *types.GeneratePresignedUploadURLOpts) (*types.GeneratePresignedUploadURLResult, error)
GeneratePresignedUploadURL generates a presigned upload URL for an object in a S3 bucket
func (*Backend) List ¶
List lists all objects in a S3 bucket, at path Note: This function does not handle pagination and will return a maximum of 1000 objects. If there are more than 1000 objects with the specified path, consider using pagination to retrieve all objects.
func (*Backend) Upload ¶
Upload uploads an object to a S3 bucket, at prefix. Will intelligently buffering large files into smaller chunks and sending them in parallel across multiple goroutines
func (*Backend) UploadPart ¶
func (b *Backend) UploadPart(ctx context.Context, opts *types.UploadPartOpts) (*types.UploadPartResult, error)
UploadPart writes a part of a multipart upload