storage

package
v0.0.0-...-5de6587 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InternalError

type InternalError struct {
	Cause string
}

func (InternalError) Error

func (e InternalError) Error() string

type Local

type Local struct {
	Dir string
}

func NewLocal

func NewLocal(dir string) *Local

func (*Local) CreateLocalDir

func (sto *Local) CreateLocalDir() error

func (*Local) DownloadFile

func (sto *Local) DownloadFile(cid string, fileName string) error

func (*Local) FileSize

func (sto *Local) FileSize(cid string) (int64, error)

func (*Local) GetFile

func (sto *Local) GetFile(cid string) string

func (*Local) SaveFile

func (sto *Local) SaveFile(filename string, fileDesc io.Reader, contentType string) (string, error)

type NotFoundError

type NotFoundError struct {
	Cause string
}

func (NotFoundError) Error

func (e NotFoundError) Error() string

type S3

type S3 struct {
	Bucket *string
	ACL    *string
	URL    string
	Agent  *metrics.Agent
}

func NewS3

func NewS3(bucket, acl, url string, agent *metrics.Agent) *S3

func (*S3) DownloadFile

func (sto *S3) DownloadFile(cid string, filePath string) error

func (*S3) FileSize

func (sto *S3) FileSize(cid string) (int64, error)

func (*S3) GetFile

func (sto *S3) GetFile(cid string) string

func (*S3) SaveFile

func (sto *S3) SaveFile(filename string, fileDesc io.Reader, contentType string) (string, error)

type Storage

type Storage interface {
	GetFile(cid string) string
	SaveFile(filename string, fileDesc io.Reader, contentType string) (string, error)
	DownloadFile(cid string, fileName string) error
	FileSize(cid string) (int64, error)
}

func NewStorage

func NewStorage(conf *config.Storage, agent *metrics.Agent) Storage

Jump to

Keyboard shortcuts

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