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 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
Click to show internal directories.
Click to hide internal directories.