Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Discards the least recently used items first. LRU evictionPolicy = iota // Discards the least frequently used items first. LFU // Adaptive replacement cache policy. ARC // Noop cache without replacement policy. NOOP )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is cache with TTL and eviction over capacity.
type Option ¶ added in v1.0.0
type Option func(*config)
Option is an option that can be applied to cache.
func WithEvictionPolicy ¶ added in v1.0.0
func WithEvictionPolicy(policy evictionPolicy) Option
WithEvictionPolicy sets eviction policy for cache.
func WithTTLEpochGranularity ¶ added in v1.0.0
WithTTLEpochGranularity sets ttl epoch granularity.
Click to show internal directories.
Click to hide internal directories.