cache

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache added in v0.2.0

type Cache interface {
	Put(data []byte) (info FileInfo, err error)
	Get(md5 string) (data []byte, err error)
	GetStat(md5 string) (fs.FileInfo, error)
}

func NewCache added in v0.2.0

func NewCache(configs ...LocalCacheFunc) (Cache, error)

type FileInfo

type FileInfo struct {
	FileID   string
	FilePath string
	Info     fs.FileInfo
}

type LocalCache added in v0.2.0

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

func (*LocalCache) Get added in v0.2.0

func (l *LocalCache) Get(id string) (data []byte, err error)

func (*LocalCache) GetStat added in v0.2.0

func (l *LocalCache) GetStat(id string) (fs.FileInfo, error)

func (*LocalCache) Put added in v0.2.0

func (l *LocalCache) Put(data []byte) (info FileInfo, err error)

userid -> langtype

func (*LocalCache) SetFile added in v0.2.0

func (l *LocalCache) SetFile(md5 string, data []byte)

type LocalCacheFunc added in v0.2.0

type LocalCacheFunc func(l *LocalCache)

func WithCacheNum added in v0.2.0

func WithCacheNum(cacheNum int) LocalCacheFunc

func WithReatLimit added in v0.2.0

func WithReatLimit(readLimit int) LocalCacheFunc

func WithSavePath added in v0.2.0

func WithSavePath(savePath string) LocalCacheFunc

Jump to

Keyboard shortcuts

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