Documentation
¶
Overview ¶
Package cache provides a simple ttl-based item cache
Index ¶
Constants ¶
View Source
const NoExpiration = gocache.NoExpiration
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
// Insert the string k
Insert(k string, v string)
// Exists proves the existence or lack-thereof of the item k in the cache
Exists(k string) (exists bool)
// Get returns the value of the key in the cache
Get(k string) (value string, err error)
// SetExpiration sets the expiration on the given item k without updating the value
SetExpiration(k string, t time.Duration) error
}
Cache provides a simple item store
func NewCacheWithTTL ¶
NewCacheWithTTL creates a new cache with ttl of t
Click to show internal directories.
Click to hide internal directories.