Skip to content
A simple, goroutine-safe, cache with a global TTL, a fixed size and an LRU eviction policy for Go (golang)
Go Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
.gitignore
LICENSE
Makefile
README.md
go.mod
go.sum
ttlheap.go
ttlru.go
ttlru_test.go

README.md

ttlru

GoDoc Circle CI Coverage Status

Package ttlru provides a simple, goroutine safe, cache with a fixed number of entries. Each entry has a per-cache defined TTL. This TTL is reset on both modification and access of the value. As a result, if the cache is full, and no items have expired, when adding a new item, the item with the soonest expiration will be evicted.

It is based on the LRU implementation in golang-lru: github.com/hashicorp/golang-lru

Which in turn is based on the LRU implementation in groupcache: github.com/golang/groupcache/lru

It should be imported as zvelo.io/ttlru.

You can’t perform that action at this time.