s3

package
v0.0.0-...-1b7048e Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoContents = errors.New("no contents")

Functions

This section is empty.

Types

type Client

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

func New

func New(logger *zap.Logger, awsCfg *cfg.AWSCfg, opts ...Opt) (*Client, error)

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, filenames []string) error

func (*Client) List

func (c *Client) List(ctx context.Context) ([]*Media, error)

func (*Client) Store

func (c *Client) Store(ctx context.Context, filename string, contentBytes []byte) error

type Media

type Media struct {
	Filename     string
	Url          string
	LastModified time.Time
}

type Opt

type Opt func(client *Client)

func WithBucketName

func WithBucketName(bucketName string) Opt

type S3

type S3 interface {
	List(ctx context.Context) ([]*Media, error)
	Store(ctx context.Context, filename string, contentBytes []byte) error
	Delete(ctx context.Context, filenames []string) error
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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