Documentation ¶
Index ¶
- type BucketFS
- func (f *BucketFS) Copy(ctx context.Context, dst, src string) error
- func (f *BucketFS) ObjectRoots(ctx context.Context, sel ocfl.PathSelector, fn func(*ocfl.ObjectRoot) error) error
- func (f *BucketFS) OpenFile(ctx context.Context, name string) (fs.File, error)
- func (f *BucketFS) ReadDir(ctx context.Context, dir string) ([]fs.DirEntry, error)
- func (f *BucketFS) Remove(ctx context.Context, name string) error
- func (f *BucketFS) RemoveAll(ctx context.Context, name string) error
- func (f *BucketFS) Write(ctx context.Context, name string, r io.Reader) (int64, error)
- type CopyAPI
- type ObjectRootsAPI
- type OpenFileAPI
- type ReadDirAPI
- type RemoveAPI
- type RemoveAllAPI
- type S3API
- type WriteAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketFS ¶
type BucketFS struct { // S3 implementation (required). S3 S3API // S3 Bucket (required). Bucket string // Logger logs method calls (using the debug log level), if set Logger *slog.Logger // DefaultUploadPartSize is the size in bytes for object // parts for multipart uploads. The default is 5MiB. If // the size of the upload can be determined and the part // size is too small to complete the upload with the max number // of parts, the part size is increased in 1 MiB increments. DefaultUploadPartSize int64 // UploadConcurrency sets the number of goroutines per // upload for sending object parts. The default it 5. UploadConcurrency int // DefaultCopyPartSize sets the size of the object parts used // for multipart object copy. If the part size is too // small to be copied using the max number of parts, // the part size will be increased in 1 MiB increments // until it fits. DefaultCopyPartSize int64 // CopyPartConcurrency stes the number of gourites // per copy for copying object parts. defaults to 12. CopyPartConcurrency int }
BucketFS implements ocfl.WriteFS, ocfl.CopyFS, and ocfl.ObjectRootIterator for an S3 bucket.
func (*BucketFS) ObjectRoots ¶
type CopyAPI ¶
type CopyAPI interface { HeadObject(context.Context, *s3v2.HeadObjectInput, ...func(*s3v2.Options)) (*s3v2.HeadObjectOutput, error) CopyObject(context.Context, *s3v2.CopyObjectInput, ...func(*s3v2.Options)) (*s3v2.CopyObjectOutput, error) CreateMultipartUpload(context.Context, *s3v2.CreateMultipartUploadInput, ...func(*s3v2.Options)) (*s3v2.CreateMultipartUploadOutput, error) UploadPartCopy(context.Context, *s3v2.UploadPartCopyInput, ...func(*s3v2.Options)) (*s3v2.UploadPartCopyOutput, error) CompleteMultipartUpload(context.Context, *s3v2.CompleteMultipartUploadInput, ...func(*s3v2.Options)) (*s3v2.CompleteMultipartUploadOutput, error) AbortMultipartUpload(context.Context, *s3v2.AbortMultipartUploadInput, ...func(*s3v2.Options)) (*s3v2.AbortMultipartUploadOutput, error) }
CopyAPI includes S3 methods needed for Copy()
type ObjectRootsAPI ¶
type ObjectRootsAPI interface {
ListObjectsV2(context.Context, *s3v2.ListObjectsV2Input, ...func(*s3v2.Options)) (*s3v2.ListObjectsV2Output, error)
}
ObjectRootsAPI includes S3 methods needed for ObjectRoots()
type OpenFileAPI ¶
type OpenFileAPI interface {
GetObject(context.Context, *s3v2.GetObjectInput, ...func(*s3v2.Options)) (*s3v2.GetObjectOutput, error)
}
OpenFileAPI includes S3 methods needed for OpenFile()
type ReadDirAPI ¶
type ReadDirAPI interface {
ListObjectsV2(context.Context, *s3v2.ListObjectsV2Input, ...func(*s3v2.Options)) (*s3v2.ListObjectsV2Output, error)
}
ReadDirAPI includes S3 methods needed for ReadDir()
type RemoveAPI ¶
type RemoveAPI interface {
DeleteObject(context.Context, *s3v2.DeleteObjectInput, ...func(*s3v2.Options)) (*s3v2.DeleteObjectOutput, error)
}
RemoveAPI includes S3 methods needed for Remove()
type RemoveAllAPI ¶
type RemoveAllAPI interface { ListObjectsV2(context.Context, *s3v2.ListObjectsV2Input, ...func(*s3v2.Options)) (*s3v2.ListObjectsV2Output, error) DeleteObject(context.Context, *s3v2.DeleteObjectInput, ...func(*s3v2.Options)) (*s3v2.DeleteObjectOutput, error) }
RemoveAllAPI includes S3 methods needed for RemoveAll()
type S3API ¶
type S3API interface { OpenFileAPI ReadDirAPI WriteAPI CopyAPI RemoveAPI RemoveAllAPI ObjectRootsAPI }
type WriteAPI ¶
type WriteAPI interface { PutObject(context.Context, *s3v2.PutObjectInput, ...func(*s3v2.Options)) (*s3v2.PutObjectOutput, error) UploadPart(context.Context, *s3v2.UploadPartInput, ...func(*s3v2.Options)) (*s3v2.UploadPartOutput, error) CreateMultipartUpload(context.Context, *s3v2.CreateMultipartUploadInput, ...func(*s3v2.Options)) (*s3v2.CreateMultipartUploadOutput, error) CompleteMultipartUpload(context.Context, *s3v2.CompleteMultipartUploadInput, ...func(*s3v2.Options)) (*s3v2.CompleteMultipartUploadOutput, error) AbortMultipartUpload(context.Context, *s3v2.AbortMultipartUploadInput, ...func(*s3v2.Options)) (*s3v2.AbortMultipartUploadOutput, error) }
WriteAPI includes S3 methods needed for Write()
Click to show internal directories.
Click to hide internal directories.