Help us shape the future of Go! Take the 2026 Go Developer Survey

storage

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: LGPL-2.1 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	S3NotEnabledErr = errors.New("storage is not enabled. Set S3 parameters to fetch files")
)

Functions

This section is empty.

Types

type NoStorage added in v0.1.20

type NoStorage struct{}

func (*NoStorage) Delete added in v0.1.24

func (ns *NoStorage) Delete(ctx context.Context, namespace, file string, force bool) error
func (ns *NoStorage) GetFileLink(ctx context.Context, namespace, file string, expiresIn time.Duration) (*url.URL, error)

func (*NoStorage) Upload added in v0.1.20

func (ns *NoStorage) Upload(ctx context.Context, data []byte, namespace, folder, fileExtension, name string, expiresIn time.Duration) (string, error)

type Storage

type Storage interface {
	Upload(ctx context.Context, data []byte, namespace, folder, fileExtension, name string, expiresIn time.Duration) (string, error)
	GetFileLink(ctx context.Context, namespace, file string, expiresIn time.Duration) (*url.URL, error)
	Delete(ctx context.Context, namespace, file string, force bool) error
}

func New added in v0.1.24

func New(logger *zap.Logger, environment *environment.Environment) (Storage, error)

func NewMinio added in v0.1.24

func NewMinio(logger *zap.Logger, environment *environment.Environment) (Storage, error)

func NewS3

func NewS3(logger *zap.Logger, environment *environment.Environment) (Storage, error)

Jump to

Keyboard shortcuts

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