v3.0.0
The version 3 of ttlcache includes many breaking changes, some of which improve the general usability and readability of the code, while others extend the current API with new Go features (mainly type parameters). The most notable of these additions/changes are:
- The new
Item
type that is returned by bothGet
andSet
methods. - The deletion of the
Close()
method. - The rename of the
Purge()
method toDeleteAll()
. - The rewritten
New
function that now accepts functional options. It also doesn't start the automatic expired item deletion process: theStart()
method needs to be explicitly called for it to be activated. - Improved event/callback registration methods.
- More predictable item deletion when the cache's capacity is reached.
- The new
Loader
interface.
All new or updated types and functions can be found on the documentation, README, or v3 issue page.