storage

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = errors.New("driver does not suppport functionality")

Functions

This section is empty.

Types

type Driver

type Driver interface {
	Get(ctx context.Context, key string) ([]byte, error)
	GetStream(ctx context.Context, key string) (io.ReadCloser, error)
	PutStream(ctx context.Context, key string, r io.Reader) error
	Put(ctx context.Context, key string, value []byte) error
	Delete(ctx context.Context, key string) error
	URL(ctx context.Context, key string) *url.URL
}

Driver implements the functionality to store and retrieve blobs (images,video,audio)

func AutoConfig

func AutoConfig() (Driver, error)

type Local

type Local struct {
	KVStore *kv.KVStore
}

func (*Local) Delete

func (l *Local) Delete(ctx context.Context, key string) error

func (*Local) Get

func (l *Local) Get(ctx context.Context, key string) ([]byte, error)

func (*Local) GetStream

func (l *Local) GetStream(ctx context.Context, key string) (io.ReadCloser, error)

func (*Local) Put

func (l *Local) Put(ctx context.Context, key string, value []byte) error

func (*Local) PutStream

func (l *Local) PutStream(ctx context.Context, key string, r io.Reader) error

func (*Local) URL

func (l *Local) URL(ctx context.Context, key string) *url.URL

type S3

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

func NewS3

func NewS3(mc *minio.Client, bucket string) *S3

func (*S3) Delete

func (s *S3) Delete(ctx context.Context, key string) error

func (*S3) Get

func (s *S3) Get(ctx context.Context, key string) ([]byte, error)

func (*S3) GetStream

func (s *S3) GetStream(ctx context.Context, key string) (io.ReadCloser, error)

func (*S3) Put

func (s *S3) Put(ctx context.Context, key string, value []byte) error

func (*S3) PutStream

func (s *S3) PutStream(ctx context.Context, key string, r io.Reader) error

func (*S3) URL

func (s *S3) URL(ctx context.Context, key string) *url.URL

Jump to

Keyboard shortcuts

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