s3

package
v0.0.0-...-0f3ec1e Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache implements a cache backed by AWS S3.

func New

func New(bucket, prefix string, logger hatchet.Logger) (*Cache, error)

New returns a new S3 cache which stores objects in the bucket with the given key prefix. A trailing slash is appended if one does not exist.

The Get and Put methods sanitize the key value. Only alpahnumerics, underscores, and dashes are allowed. All other characters are replaced by underscores. Ensure keys match this pattern in order to avoid collisions due to the sanitization.

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, key string) (io.ReadCloser, error)

func (*Cache) Put

func (c *Cache) Put(ctx context.Context, key string, data io.Reader) error

func (*Cache) Shutdown

func (c *Cache) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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