storager

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

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

Go to latest
Published: Jun 13, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrQiniuZoneCodeNotFound = errors.New("qiniu zone code not found")
)

Functions

This section is empty.

Types

type Storager

type Storager interface {
	Save(name string, reader io.Reader) error
	OpenMetadata(name string) (io.ReadCloser, error)
	Delete(name string) error
	Move(src, dest string) error
	PublicURL(publicURL, name string) (string, error)
}

func NewAferoStorager

func NewAferoStorager(fs afero.Fs) Storager

func NewAliOssStorager

func NewAliOssStorager(endpoint, accessKeyId, accessKeySecret, bucketName, domain string) (Storager, error)

endpoint: https://help.aliyun.com/document_detail/31837.htm

func NewBasePathStorager

func NewBasePathStorager(basepath string, store Storager) Storager

func NewMemStorager

func NewMemStorager() Storager

func NewOsFileStorager

func NewOsFileStorager(basepath string) Storager

func NewQiniuStorager

func NewQiniuStorager(zone, accessKey, secretKey, bucket, domain string) (Storager, error)

zone option: huadong:z0 huabei:z1 huanan:z2 northAmerica:na0 singapore:as0 fogCnEast1:fog-cn-east-1 domain required: https://file.example.com

func NewS3Storager

func NewS3Storager(endpoint, ak, sk, bucket, domain string) (Storager, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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