Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiskCacheConfig ¶
type DualCache ¶
type DualCache struct { // Lock to save the map of keys sync.RWMutex // Config of this dual cache DualCacheConfig // contains filtered or unexported fields }
func NewDualCache ¶
func NewDualCache(cfg DualCacheConfig) (*DualCache, error)
NewDualCache : Method to create object of dual cache
type DualCacheConfig ¶
type DualCacheConfig struct { // Config for memory based caching MemConfig MemCacheconfig // Config for disk based caching DiskConfig DiskCacheConfig // Callback Function to write data to disk Log func(string) }
DualCacheConfig : Config params for dual-cache
type MemCacheconfig ¶
type TLRU ¶
type TLRU struct { // Lock for the TLRU sync.Mutex // Timeout to evict the nodes which are not used for given interval Timeout uint32 // Timeout to callback application to check if it wants to evict last node AppCheckTimeout uint32 // Number of nodes allowed in the list MaxNodes uint32 // Function called back for eviceted nodes Evict func(*list.Element) // Function to check if application wants to force evict last node AppCheck func() bool // contains filtered or unexported fields }
func New ¶
func New(maxNodes, timeout uint32, evict func(*list.Element), appchecktimeout uint32, appcheck func() bool) (*TLRU, error)
NewTLRU : Create a new Time based LRU
Click to show internal directories.
Click to hide internal directories.