package
Version:
v0.0.0-...-3de5202
Opens a new window with list of versions in this module.
Published: Jul 5, 2024
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
type Store
-
func BigCache(expirationTime time.Duration, cleanupInterval time.Duration, shards int, ...) (Store, error)
-
func LRUCache(size uint, onEvicted func(key interface{}, value interface{})) (Store, error)
-
func SampleCache() Store
-
func TTLCache(expirationTime, cleanupInterval time.Duration, shards int, ...) Store
type Store interface {
Get(key string) (interface{}, bool)
Set(key string, val interface{})
}
Store 定义接口
func BigCache(
expirationTime time.Duration,
cleanupInterval time.Duration,
shards int,
onEvicted func(key string, entry []byte),
marshal func(key string, obj interface{}) ([]byte, error),
unmarshal func(key string, data []byte) (interface{}, error),
errHandler func(err error),
) (Store, error)
func LRUCache(
size uint,
onEvicted func(key interface{}, value interface{}),
) (Store, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.