Documentation
¶
Index ¶
- Constants
- Variables
- type Adapter
- type ComposeAdapter
- type DirectDownloadAdapter
- type FilesystemAdapter
- func (a *FilesystemAdapter) Clear(_ context.Context) error
- func (a *FilesystemAdapter) CopyObject(ctx context.Context, sourceObjectName, destinationObjectName string) error
- func (a *FilesystemAdapter) CountFilesInFolder(_ context.Context, folderName string) (int, error)
- func (a *FilesystemAdapter) CreateDownloadStream(_ context.Context, objectName string) (io.ReadCloser, error)
- func (a *FilesystemAdapter) DeleteFolder(_ context.Context, folderName string) error
- func (a *FilesystemAdapter) UploadStream(ctx context.Context, objectName string, stream io.Reader) error
- type ObjectNotFoundError
- type S3Adapter
- func (a *S3Adapter) Clear(ctx context.Context) error
- func (a *S3Adapter) ComposeObjects(ctx context.Context, destinationObjectName string, sourceObjectNames []string) error
- func (a *S3Adapter) CopyObject(ctx context.Context, sourceObjectName, destinationObjectName string) error
- func (a *S3Adapter) CountFilesInFolder(ctx context.Context, folderName string) (int, error)
- func (a *S3Adapter) CreateDownloadStream(ctx context.Context, objectName string) (io.ReadCloser, error)
- func (a *S3Adapter) CreateDownloadURL(ctx context.Context, objectName string, ttl time.Duration) (string, error)
- func (a *S3Adapter) DeleteFolder(ctx context.Context, folderName string) error
- func (a *S3Adapter) UploadStream(ctx context.Context, objectName string, stream io.Reader) error
Constants ¶
View Source
const ( DriverFilesystem = "filesystem" DriverS3 = "s3" )
Variables ¶
View Source
var ( ErrObjectNotFound = errors.New("object not found in storage") ErrComposeUnsupported = errors.New("object sequence cannot be composed by this storage backend") )
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface {
UploadStream(ctx context.Context, objectName string, stream io.Reader) error
CopyObject(ctx context.Context, sourceObjectName, destinationObjectName string) error
CreateDownloadStream(ctx context.Context, objectName string) (io.ReadCloser, error)
DeleteFolder(ctx context.Context, folderName string) error
CountFilesInFolder(ctx context.Context, folderName string) (int, error)
Clear(ctx context.Context) error
}
func NewAdapter ¶
type ComposeAdapter ¶ added in v1.0.6
type DirectDownloadAdapter ¶
type FilesystemAdapter ¶
type FilesystemAdapter struct {
// contains filtered or unexported fields
}
func NewFilesystemAdapter ¶
func NewFilesystemAdapter(root string) (*FilesystemAdapter, error)
func (*FilesystemAdapter) CopyObject ¶ added in v1.0.6
func (a *FilesystemAdapter) CopyObject(ctx context.Context, sourceObjectName, destinationObjectName string) error
func (*FilesystemAdapter) CountFilesInFolder ¶
func (*FilesystemAdapter) CreateDownloadStream ¶
func (a *FilesystemAdapter) CreateDownloadStream(_ context.Context, objectName string) (io.ReadCloser, error)
func (*FilesystemAdapter) DeleteFolder ¶
func (a *FilesystemAdapter) DeleteFolder(_ context.Context, folderName string) error
func (*FilesystemAdapter) UploadStream ¶
type ObjectNotFoundError ¶
type ObjectNotFoundError struct {
ObjectName string
}
func (ObjectNotFoundError) Error ¶
func (e ObjectNotFoundError) Error() string
func (ObjectNotFoundError) Unwrap ¶
func (e ObjectNotFoundError) Unwrap() error
type S3Adapter ¶
type S3Adapter struct {
// contains filtered or unexported fields
}
func NewS3Adapter ¶
func (*S3Adapter) ComposeObjects ¶ added in v1.0.6
func (*S3Adapter) CopyObject ¶ added in v1.0.6
func (*S3Adapter) CountFilesInFolder ¶
func (*S3Adapter) CreateDownloadStream ¶
func (*S3Adapter) CreateDownloadURL ¶
func (*S3Adapter) DeleteFolder ¶
Click to show internal directories.
Click to hide internal directories.