Documentation ¶
Overview ¶
Package cache implements an inmemory cache for any interface{} object.
Although exported, this package is non intended for general consumption. It is a shared dependency between multiple exposure notifications projects. We cannot guarantee that there won't be breaking changes in the future.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidDuration = errors.New("expireAfter duration cannot be negative")
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) Clear ¶ added in v0.26.0
func (c *Cache) Clear()
Clear removes all items from the cache, regardless of their expiration.
func (*Cache) Lookup ¶
Lookup checks the cache for a non-expired object by the supplied key name. The bool return informs the caller if there was a cache hit or not. A return of nil, true means that nil is in the cache. Where nil, false indicates a cache miss or that the value is expired and should be refreshed.