s3

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter provides an S3 implementation of filekit.FileSystem

func New

func New(client *s3.Client, bucket string, options ...AdapterOption) *Adapter

New creates a new S3 filesystem adapter

func (*Adapter) AbortUpload

func (a *Adapter) AbortUpload(ctx context.Context, uploadID string) error

AbortUpload implements filekit.ChunkedUploader

func (*Adapter) CompleteUpload

func (a *Adapter) CompleteUpload(ctx context.Context, uploadID string) error

CompleteUpload implements filekit.ChunkedUploader

func (*Adapter) CreateDir

func (a *Adapter) CreateDir(ctx context.Context, dirPath string) error

CreateDir implements filekit.FileSystem

func (*Adapter) Delete

func (a *Adapter) Delete(ctx context.Context, filePath string) error

Delete implements filekit.FileSystem

func (*Adapter) DeleteDir

func (a *Adapter) DeleteDir(ctx context.Context, dirPath string) error

DeleteDir implements filekit.FileSystem

func (*Adapter) Download

func (a *Adapter) Download(ctx context.Context, filePath string) (io.ReadCloser, error)

Download implements filekit.FileSystem

func (*Adapter) Exists

func (a *Adapter) Exists(ctx context.Context, filePath string) (bool, error)

Exists implements filekit.FileSystem

func (*Adapter) FileInfo

func (a *Adapter) FileInfo(ctx context.Context, filePath string) (*filekit.File, error)

FileInfo implements filekit.FileSystem

func (*Adapter) GeneratePresignedGetURL added in v0.1.0

func (a *Adapter) GeneratePresignedGetURL(ctx context.Context, filePath string, expiry time.Duration) (string, error)

func (*Adapter) GeneratePresignedPutURL added in v0.1.0

func (a *Adapter) GeneratePresignedPutURL(ctx context.Context, filePath string, expiry time.Duration, options ...filekit.Option) (string, error)

func (*Adapter) InitiateUpload

func (a *Adapter) InitiateUpload(ctx context.Context, filePath string) (string, error)

InitiateUpload implements filekit.ChunkedUploader

func (*Adapter) List

func (a *Adapter) List(ctx context.Context, prefix string) ([]filekit.File, error)

List implements filekit.FileSystem

func (*Adapter) Upload

func (a *Adapter) Upload(ctx context.Context, filePath string, content io.Reader, options ...filekit.Option) error

Upload implements filekit.FileSystem

func (*Adapter) UploadFile

func (a *Adapter) UploadFile(ctx context.Context, path string, localPath string, options ...filekit.Option) error

UploadFile implements filekit.Uploader

func (*Adapter) UploadPart

func (a *Adapter) UploadPart(ctx context.Context, uploadID string, partNumber int, data []byte) error

UploadPart implements filekit.ChunkedUploader

type AdapterOption

type AdapterOption func(*Adapter)

AdapterOption is a function that configures S3Adapter

func WithPrefix

func WithPrefix(prefix string) AdapterOption

WithPrefix sets the prefix for S3 objects

Jump to

Keyboard shortcuts

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