rrstorage

package
v0.0.0-...-ea46046 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: Apache-2.0 Imports: 14 Imported by: 7

Documentation

Index

Constants

View Source
const (
	EXPIRE       = 3600
	SUFFIX       = ".ufile.ucloud.cn"
	MAX_PUT_SIZE = 50 * (1 << 20)
	MAX_GET_SIZE = 50 * (1 << 20)
	PARTIAL_SIZE = 4 * (1 << 20)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalDiskStorage

type LocalDiskStorage struct {
	Dir string // the directory where to save binary
}

local disk storage

func (*LocalDiskStorage) Fetch

func (s *LocalDiskStorage) Fetch(filename string) ([]byte, error)

func (*LocalDiskStorage) Save

func (s *LocalDiskStorage) Save(data []byte, filename string) error

Do save binary

type StorageWrapper

type StorageWrapper interface {
	Save([]byte, string) error // do save binary
	Fetch(string) ([]byte, error)
}

Gerneral storage wrapper

func CreateLocalDiskStorage

func CreateLocalDiskStorage(dir string) StorageWrapper

Create a LocalDiskStorage instance

func CreateUfileStorage

func CreateUfileStorage(pub, pri, bun string, ucl int) StorageWrapper

type UfileStorage

type UfileStorage struct {
	PublicKey  string
	PrivateKey string
	BucketName string
	// contains filtered or unexported fields
}

func (*UfileStorage) Fetch

func (s *UfileStorage) Fetch(filename string) ([]byte, error)

func (*UfileStorage) PrefixFileList

func (s *UfileStorage) PrefixFileList(prefix string) (*fileList, error)

func (*UfileStorage) Save

func (s *UfileStorage) Save(content []byte, filename string) error

Jump to

Keyboard shortcuts

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