Documentation
¶
Index ¶
- type Backend
- type BucketObject
- type S3Backend
- func (b *S3Backend) BatchDeleteObjects(objects []BucketObject) error
- func (b *S3Backend) CopyObject(sourceObject BucketObject, destinationObject BucketObject) error
- func (b *S3Backend) CreatePresignedURLForDownload(object BucketObject, expire time.Duration) (string, error)
- func (b *S3Backend) CreatePresignedURLForUpload(object BucketObject, expire time.Duration) (string, error)
- func (b *S3Backend) DeleteObject(object BucketObject) error
- type S3BackendConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { // CreatePresignedURLForUpload creates a presigned URL for uploading file to the bucket CreatePresignedURLForUpload(object BucketObject, expire time.Duration) (string, error) // CreatePresignedURLForDownload creates a presigned URL for downloading file from the bucket CreatePresignedURLForDownload(object BucketObject, expire time.Duration) (string, error) // DeleteObject delete an object in a bucket DeleteObject(object BucketObject) error // BatchDeleteObject delete an object in a bucket BatchDeleteObjects(objects []BucketObject) error // CopyObject copies one item from a bucket to another // sourceObject : source object (ex: mybucket and /folder/item) // destinationObject : destination object (ex: mybucket and /folder/item2) CopyObject(sourceObject BucketObject, destinationObject BucketObject) error }
Backend provides an interface for S3
func NewS3Backend ¶
func NewS3Backend(config ...S3BackendConfig) (Backend, error)
Create a new backend for s3 compatible backend
type BucketObject ¶
BucketObject is a tuple containing an object key (ex: /folder/item) and a bucket name (ex: mybucket)
func (BucketObject) FullPath ¶
func (b BucketObject) FullPath() string
func (BucketObject) String ¶
func (b BucketObject) String() string
type S3Backend ¶
type S3Backend struct {
// contains filtered or unexported fields
}
s3backend which will implement Backend interface
func (*S3Backend) BatchDeleteObjects ¶
func (b *S3Backend) BatchDeleteObjects(objects []BucketObject) error
BatchDeleteObjects deletes a list of objects in batch mode
func (*S3Backend) CopyObject ¶
func (b *S3Backend) CopyObject(sourceObject BucketObject, destinationObject BucketObject) error
Copy item from source to destination bucket
func (*S3Backend) CreatePresignedURLForDownload ¶
func (b *S3Backend) CreatePresignedURLForDownload(object BucketObject, expire time.Duration) (string, error)
Create a presigned url for a download of an object
func (*S3Backend) CreatePresignedURLForUpload ¶
func (b *S3Backend) CreatePresignedURLForUpload(object BucketObject, expire time.Duration) (string, error)
Create a presigned url for an upload of an object
func (*S3Backend) DeleteObject ¶
func (b *S3Backend) DeleteObject(object BucketObject) error
Delete action for an object in a bucket
Directories
¶
Path | Synopsis |
---|---|
Package backendtest provides utilities for backend testing
|
Package backendtest provides utilities for backend testing |
Click to show internal directories.
Click to hide internal directories.