Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("key not found")
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a generic cache implementation with support for time-to-live (TTL) expiration.
func New ¶
func New() *Cache
NewTTL creates a new TTLCache instance and starts a goroutine to periodically remove expired items every 5 seconds.
Click to show internal directories.
Click to hide internal directories.