Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type TTLCache ¶
type TTLCache interface {
// Get fetches a value from cache, returns nil, false on miss.
Get(key string) (value interface{}, expired bool, ok bool)
// Set sets a value in cache. This overwrites any existing value.
Set(key string, value interface{})
// Delete deletes the value from the cache.
Delete(key string)
// GetTTL gets the time-to-live of the cache.
GetTTL() *TTL
// SetTTL sets the time-to-live of the cache.
SetTTL(ttl *TTL)
}
func NewTTLCache ¶
NewTTLCache creates a TTL cache with optional TTL for items.
Click to show internal directories.
Click to hide internal directories.