Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache store element with a expired time
func (Cache) Get ¶
func (c Cache) Get(key interface{}) interface{}
Get element in Cache, and drop when it expired
func (Cache) GetWithExpire ¶
GetWithExpire element in Cache with Expire Time
type LruCache ¶ added in v1.17.3
type LruCache struct {
// contains filtered or unexported fields
}
LruCache is a thread-safe, in-memory lru-cache that evicts the least recently used entries from memory when (if set) the entries are older than maxAge (in seconds). Use the New constructor to create one.
func NewLRUCache ¶ added in v1.17.3
NewLRUCache creates an LruCache
type Option ¶ added in v1.17.3
type Option func(*LruCache)
Option is part of Functional Options Pattern
func WithUpdateAgeOnGet ¶ added in v1.17.3
func WithUpdateAgeOnGet() Option
WithUpdateAgeOnGet update expires when Get element
Click to show internal directories.
Click to hide internal directories.