package s3

import "git.sr.ht/~pingoo/stdx/storage/s3"

Index

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

Source Files

s3.go

Version
v0.0.0-20240218134121-094174641f6e (latest)
Published
Feb 18, 2024
Platform
linux/amd64
Imports
10 packages
Last checked
4 months ago

Tools for package owners.