s3

package
v0.0.25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

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) Copy

func (f *BucketFS) Copy(ctx context.Context, dst, src string) error

func (*BucketFS) ObjectRoots

func (f *BucketFS) ObjectRoots(ctx context.Context, sel ocfl.PathSelector, fn func(*ocfl.ObjectRoot) error) error

func (*BucketFS) OpenFile

func (f *BucketFS) OpenFile(ctx context.Context, name string) (fs.File, error)

func (*BucketFS) ReadDir

func (f *BucketFS) ReadDir(ctx context.Context, dir string) ([]fs.DirEntry, error)

func (*BucketFS) Remove

func (f *BucketFS) Remove(ctx context.Context, name string) error

func (*BucketFS) RemoveAll

func (f *BucketFS) RemoveAll(ctx context.Context, name string) error

func (*BucketFS) Write

func (f *BucketFS) Write(ctx context.Context, name string, r io.Reader) (int64, error)

type CopyAPI

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 WriteAPI

WriteAPI includes S3 methods needed for Write()

Directories

Path Synopsis
example
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL