s3

package
v2.0.0-...-63c53bf Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S3Client

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

func New

func New(log *log.Logger, bucket string, regionHint string) (*S3Client, error)

func NewFromConfig

func NewFromConfig(cfg aws.Config, bucket string) *S3Client

func (*S3Client) Bucket

func (c *S3Client) Bucket() string

func (*S3Client) BucketExists

func (c *S3Client) BucketExists() (bool, error)

BucketExists returns whether the bucket exists. 200 OK returns true without error. 404 Not Found and 403 Forbidden return false without error. Other errors result in false with an error.

func (*S3Client) Get

func (c *S3Client) Get(key string) ([]byte, error)

Get downloads an object from S3. Intended for small files; object is fully read into memory. sentinel.ErrNotFound and sentinel.ErrForbidden are returned for those cases. Other errors are returned verbatim.

func (*S3Client) ListSuffix

func (c *S3Client) ListSuffix(prefix string, suffixes []string) ([]string, error)

ListSuffix returns a list of keys in the bucket that have the given prefix and suffix. This has a maximum of 1000 keys, for now. This can be expanded by using the continuation token.

func (*S3Client) Region

func (c *S3Client) Region() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳