Documentation ¶
Index ¶
- type ChecksumAlgorithm
- type Client
- type CompleteMultipartUploadInput
- type CreateMultipartUploadInput
- type DeleteObjectInput
- type File
- func (f *File) Size() (int64, error)
- func (f *File) ToCompleteMultipartUploadInput(uploadID string, parts []*UploadPartOutput) *CompleteMultipartUploadInput
- func (f *File) ToCreateMultipartUploadInput() *CreateMultipartUploadInput
- func (f *File) ToPutObjectInput() *PutObjectInput
- func (f *File) ToUploadPartInput(uploadID string, chunkNum int32, chunkSize int64) *UploadPartInput
- type Option
- type PutObjectInput
- type StorageClass
- type Store
- type UploadPartInput
- type UploadPartOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChecksumAlgorithm ¶
type ChecksumAlgorithm = types.ChecksumAlgorithm
ChecksumAlgorithm defines the algorithm used to generate a checksum when verifying uploads to the storage backend.
type Client ¶
type Client interface { PutObject( ctx context.Context, input *s3.PutObjectInput, optFns ...func(*s3.Options), ) (*s3.PutObjectOutput, error) CreateMultipartUpload( ctx context.Context, input *s3.CreateMultipartUploadInput, optFns ...func(*s3.Options), ) (*s3.CreateMultipartUploadOutput, error) UploadPart( ctx context.Context, input *s3.UploadPartInput, optFns ...func(*s3.Options), ) (*s3.UploadPartOutput, error) CompleteMultipartUpload( ctx context.Context, input *s3.CompleteMultipartUploadInput, optFns ...func(*s3.Options), ) (*s3.CompleteMultipartUploadOutput, error) }
Client is the interface required to interact with a storage backend.
type CompleteMultipartUploadInput ¶
type CompleteMultipartUploadInput s3.CompleteMultipartUploadInput
CompleteMultipartUploadInput defines the input data required to finalise a multi-part file.
type CreateMultipartUploadInput ¶
type CreateMultipartUploadInput s3.CreateMultipartUploadInput
CreateMultipartUploadInput defines the input data required to initiate a multi-part file.
type DeleteObjectInput ¶
type DeleteObjectInput s3.DeleteObjectInput
DeleteObjectInput defines the input data required to delete a file.
type File ¶
type File struct { Key string Bucket string ChecksumAlgorithm ChecksumAlgorithm StorageClass StorageClass File fs.File }
File encapsulates all information about a particular file required by the storage client.
func NewFileFromDomain ¶
func NewFileFromDomain( domainFile *processor.File, checksumAlgorithm ChecksumAlgorithm, storageClass StorageClass, file fs.File, ) *File
NewFileFromDomain creates a store file model from the provided domain file and checksum algorithm.
func (*File) ToCompleteMultipartUploadInput ¶
func (f *File) ToCompleteMultipartUploadInput( uploadID string, parts []*UploadPartOutput, ) *CompleteMultipartUploadInput
ToCompleteMultipartUploadInput constructs an CompleteMultipartUploadInput from the file this method is called on.
func (*File) ToCreateMultipartUploadInput ¶
func (f *File) ToCreateMultipartUploadInput() *CreateMultipartUploadInput
ToCreateMultipartUploadInput constructs a multi-part upload creation input from the file this method is called on.
func (*File) ToPutObjectInput ¶
func (f *File) ToPutObjectInput() *PutObjectInput
ToPutObjectInput constructs an PutObjectInput from the file this method is called on.
func (*File) ToUploadPartInput ¶
func (f *File) ToUploadPartInput( uploadID string, chunkNum int32, chunkSize int64, ) *UploadPartInput
ToUploadPartInput constructs an UploadPartInput from the file this method is called on.
type Option ¶
type Option func(*Store)
Option defines the interface for configuring options on a Store instance.
func WithChecksumAlgorithm ¶
func WithChecksumAlgorithm(algorithm ChecksumAlgorithm) Option
WithChecksumAlgorithm returns a Option that sets the checksum algorithm on the provided store.
func WithChunkSize ¶
WithChunkSize returns a Option that sets the chunk size on the provided store.
func WithStorageClass ¶
func WithStorageClass(storageClass StorageClass) Option
WithStorageClass returns a Option that sets the checksum algorithm on the provided store.
type PutObjectInput ¶
type PutObjectInput s3.PutObjectInput
PutObjectInput defines the input required to upload an object to a storage backend.
type StorageClass ¶
type StorageClass = types.StorageClass
StorageClass denotes a particular storage class, as specified by the storage backend.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store encapsulates the logic required to store a file in a storage bucket.
func New ¶
New instantiates a new file store with provided filesystem, uploader selector and checksum algorithm.
type UploadPartInput ¶
type UploadPartInput s3.UploadPartInput
UploadPartInput defines the input data required to upload one part of a multi-part upload.
type UploadPartOutput ¶
type UploadPartOutput s3.UploadPartOutput
UploadPartOutput defines the input data returned after uploading one part of a multi-part upload.