Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache []*cacheShard
type Clock ¶ added in v1.5.0
type Clock interface {
Now() time.Time
}
Clock defines an interface for obtaining the current time
type LRUExpireCache ¶
type LRUExpireCache struct {
// contains filtered or unexported fields
}
func NewLRUExpireCache ¶
func NewLRUExpireCache(maxSize int) *LRUExpireCache
NewLRUExpireCache creates an expiring cache with the given size
func NewLRUExpireCacheWithClock ¶ added in v1.5.0
func NewLRUExpireCacheWithClock(maxSize int, clock Clock) *LRUExpireCache
NewLRUExpireCache creates an expiring cache with the given size, using the specified clock to obtain the current time
Click to show internal directories.
Click to hide internal directories.