package
0.3.1
Repository: https://github.com/u2takey/go-utils.git
Documentation: pkg.go.dev

# Functions

NewExpiring returns an initialized expiring cache.
NewExpiringWithClock is like NewExpiring but allows passing in a custom clock for testing.
NewLRUExpireCache creates an expiring cache with the given size.
NewLRUExpireCacheWithClock creates an expiring cache with the given size, using the specified clock to obtain the current time.

# Structs

Expiring is a map whose entries expire after a per-entry timeout.
LRUExpireCache is a cache that ensures the mostly recently accessed keys are returned with a ttl beyond which keys are forcibly expired.

# Interfaces

Clock defines an interface for obtaining the current time.