storage

package
v0.7.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyExists = storage.ErrAlreadyExists

ErrAlreadyExists is a ptr to underlying storage.ErrAlreadyExists, to put the related errors in the same package as our storage wrapper.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	// Underlying storage
	*kv.KVStore
	Storage storage.Storage

	// S3-only parameters
	Proxy          bool
	Bucket         string
	PresignedCache *ttl.Cache[string, *url.URL]
}

Driver wraps a kv.KVStore to also provide S3 presigned GET URLs.

func AutoConfig

func AutoConfig() (*Driver, error)

func NewFileStorage added in v0.6.0

func NewFileStorage() (*Driver, error)

func NewS3Storage added in v0.6.0

func NewS3Storage() (*Driver, error)

func (*Driver) URL

func (d *Driver) URL(ctx context.Context, key string) *url.URL

URL will return a presigned GET object URL, but only if running on S3 storage with proxying disabled.

Jump to

Keyboard shortcuts

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