udwCache

package
v0.0.0-...-f254aa5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 21 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileMd5Get

func FileMd5Get(dbFilePath string, cb func(getter FileMd5Getter))

func FileMd5TryFreeMemory

func FileMd5TryFreeMemory()

func FileTtlCache

func FileTtlCache(key string, f func() (b []byte, ttl time.Duration, err error)) (b []byte, err error)

func MustKvdbGet

func MustKvdbGet(s string, obj interface{}) bool

func MustKvdbGetBytes

func MustKvdbGetBytes(s string) (b []byte)

func MustKvdbSet

func MustKvdbSet(s string, obj interface{})

func MustKvdbSetBytes

func MustKvdbSetBytes(s string, b []byte)

func MustMd5FileChangeCache

func MustMd5FileChangeCache(key string, pathList []string, f func()) (hasChange bool)

func MustMd5FileChangeCacheClean

func MustMd5FileChangeCacheClean()

func MustMd5FileChangeCacheV2

func MustMd5FileChangeCacheV2(key string, pathListF func() (pathListF []string, hasChange bool), f func()) (hasChange bool)

func MustMd5FileChangeCacheV3

func MustMd5FileChangeCacheV3(req MustMd5FileChangeCacheV3Request) (hasChange bool)

func SetMd5FileWithBuf

func SetMd5FileWithBuf(cb func(path string, innerBuf []byte) ([16]byte, error))

Types

type AsyncTtlCache

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

func NewAsyncCache

func NewAsyncCache() *AsyncTtlCache

func (*AsyncTtlCache) DoWithTtl

func (s *AsyncTtlCache) DoWithTtl(key string, f func() (value interface{}, ttl uint32, canSave bool)) (value interface{}, ttl uint32)

func (*AsyncTtlCache) GcThread

func (s *AsyncTtlCache) GcThread()

func (*AsyncTtlCache) Len

func (s *AsyncTtlCache) Len() int

type FileMd5GetByFullPath

type FileMd5GetByFullPath func(path string) string

type FileMd5Getter

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

func (FileMd5Getter) Close

func (getter FileMd5Getter) Close()

func (FileMd5Getter) GetMd5ByFullPath__NOLOCK

func (getter FileMd5Getter) GetMd5ByFullPath__NOLOCK(path string) string

func (FileMd5Getter) GetMd5ByStatAndFullPath__NOLOCK

func (getter FileMd5Getter) GetMd5ByStatAndFullPath__NOLOCK(statAndFullPath udwFile.StatAndFullPath) string

type FileMd5GetterWithLock

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

func NewFileMd5GetterWithLock

func NewFileMd5GetterWithLock(dbFilePath string) FileMd5GetterWithLock

func (FileMd5GetterWithLock) Close

func (getter FileMd5GetterWithLock) Close()

func (FileMd5GetterWithLock) GetMd5ByFullPath

func (getter FileMd5GetterWithLock) GetMd5ByFullPath(path string) string

func (FileMd5GetterWithLock) GetMd5ByStatAndFullPath

func (getter FileMd5GetterWithLock) GetMd5ByStatAndFullPath(statAndFullPath udwFile.StatAndFullPath) string

type MemoryTtlCacheV2

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

func NewMemoryTtlCacheV2

func NewMemoryTtlCacheV2() *MemoryTtlCacheV2

func (*MemoryTtlCacheV2) Do

func (s *MemoryTtlCacheV2) Do(key string, f func() (value interface{}, ttl time.Duration, err error)) (value interface{}, err error)

func (*MemoryTtlCacheV2) GcThread

func (s *MemoryTtlCacheV2) GcThread()

func (*MemoryTtlCacheV2) Remove

func (s *MemoryTtlCacheV2) Remove(key string)

type MustMd5FileChangeCacheV3Request

type MustMd5FileChangeCacheV3Request struct {
	Key               string
	MetaCacheFilePath string
	Md5CacheFilePath  string
	PathListF         func() (pathListF []string, hasChange bool)
	F                 func()
	Ignore            func(fullPath string) bool
}

type NewFileMd5GetterRequest

type NewFileMd5GetterRequest struct {
	DbFilePath        string
	Md5FileSumWithBuf func(path string, innerBuf []byte) (string, error)
}

type TtlCache

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

func NewTtlCache

func NewTtlCache() *TtlCache

func (*TtlCache) DoWithTtl

func (s *TtlCache) DoWithTtl(key string, f func() (value interface{}, ttl uint32, err error)) (value interface{}, ttl uint32, err error)

func (*TtlCache) GcThread

func (s *TtlCache) GcThread()

Jump to

Keyboard shortcuts

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