Documentation
¶
Overview ¶
Package freshness 实现一个新鲜度 map, 新鲜度指的是存取时间的新鲜度, 如果一个值经常被存取, 可能永远不会过期
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[K constraints.Ordered, V any] interface { Get(key K) (V, bool) Set(key K, value V) (swapped bool) GetOrNew(key K) (V, bool, error) Close() }
Map 实现一个新鲜度 map
type Option ¶
type Option func(*options)
func WithExpireCallback ¶
func WithExpireCallback[K constraints.Ordered, V any](f func(key K, value V)) Option
func WithRenewTime ¶
func WithTimeout ¶
Click to show internal directories.
Click to hide internal directories.