storage

package
v0.0.0-...-6882831 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchDownload

func BatchDownload(ctx context.Context, s Storage, fileNames []string) [][]byte

Types

type FastDFSStorage

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

func NewFastDFS

func NewFastDFS(opts ...FastDFSStorageOption) (*FastDFSStorage, error)

func (*FastDFSStorage) Close

func (f *FastDFSStorage) Close()

func (*FastDFSStorage) Download

func (f *FastDFSStorage) Download(fileName string) (data []byte, err error)

func (*FastDFSStorage) Save

func (f *FastDFSStorage) Save(fileName string, data []byte) (filePath string, err error)

type FastDFSStorageOption

type FastDFSStorageOption func(*FastDFSStorage)

func WithFastDFSMaxConn

func WithFastDFSMaxConn(max int) FastDFSStorageOption

func WithFastDFSTrackerPath

func WithFastDFSTrackerPath(trackers ...string) FastDFSStorageOption

type LocalStorage

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

func (*LocalStorage) Close

func (l *LocalStorage) Close()

func (*LocalStorage) Download

func (l *LocalStorage) Download(fileName string) ([]byte, error)

func (*LocalStorage) Save

func (l *LocalStorage) Save(fileName string, data []byte) (filePath string, err error)

type LocalStorageOption

type LocalStorageOption func(*LocalStorage)

func WithLocalPathPrefix

func WithLocalPathPrefix(prefix string) LocalStorageOption

type Storage

type Storage interface {
	Save(fileName string, data []byte) (filePath string, err error)
	Download(fileName string) (data []byte, err error)
	Close()
}

func NewLocal

func NewLocal(opts ...LocalStorageOption) Storage

Jump to

Keyboard shortcuts

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