storage

package
v0.0.0-...-9b4e594 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFileKeyNotFound = errors.New("fileKey not found")

Functions

This section is empty.

Types

type BlobStorage

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

func NewBlobStorage

func NewBlobStorage(config Config) (*BlobStorage, error)

func (*BlobStorage) SendFile

func (svc *BlobStorage) SendFile(ctx context.Context, fileKey string, reader io.ReadSeeker) error

type Config

type Config = config.StorageConfig

type MemoryStorage

type MemoryStorage struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewMemoryStorage

func NewMemoryStorage() *MemoryStorage

func (*MemoryStorage) FileExists

func (ms *MemoryStorage) FileExists(fileKey string) bool

func (*MemoryStorage) GetAllFiles

func (ms *MemoryStorage) GetAllFiles() map[string][]byte

func (*MemoryStorage) GetFile

func (ms *MemoryStorage) GetFile(fileKey string) ([]byte, error)

func (*MemoryStorage) RemoveFile

func (ms *MemoryStorage) RemoveFile(fileKey string) error

func (*MemoryStorage) SendFile

func (ms *MemoryStorage) SendFile(ctx context.Context, fileKey string, reader io.ReadSeeker) error

type NoneStorage

type NoneStorage struct{}

func NewNoneStorage

func NewNoneStorage() *NoneStorage

func (*NoneStorage) SendFile

func (ns *NoneStorage) SendFile(ctx context.Context, fileKey string, reader io.ReadSeeker) error

type S3Storage

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

func NewS3Storage

func NewS3Storage(cfg Config, region string) *S3Storage

func (*S3Storage) SendFile

func (svc *S3Storage) SendFile(ctx context.Context, fileKey string, reader io.ReadSeeker) error

Jump to

Keyboard shortcuts

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