s3

package
v0.0.0-...-0941746 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AccessKeyID     string
	SecretAccessKey string
	Endpoint        string
	Region          string
	BaseDirectory   string
	Bucket          string
	HttpClient      *http.Client
}

type S3Storage

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

func NewS3Storage

func NewS3Storage(config Config) (*S3Storage, error)

func (*S3Storage) BasePath

func (storage *S3Storage) BasePath() string

func (*S3Storage) CopyObject

func (storage *S3Storage) CopyObject(ctx context.Context, from string, to string) error

func (*S3Storage) DeleteObject

func (storage *S3Storage) DeleteObject(ctx context.Context, key string) error

func (*S3Storage) DeleteObjectsWithPrefix

func (storage *S3Storage) DeleteObjectsWithPrefix(ctx context.Context, prefix string) (err error)

func (*S3Storage) GetObject

func (storage *S3Storage) GetObject(ctx context.Context, key string) (io.ReadCloser, error)

func (*S3Storage) GetObjectSize

func (storage *S3Storage) GetObjectSize(ctx context.Context, key string) (int64, error)

func (*S3Storage) PutObject

func (storage *S3Storage) PutObject(ctx context.Context, key string, contentType string, size int64, object io.Reader) error

TODO?: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html

Jump to

Keyboard shortcuts

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