This repository has been archived by the owner on Aug 20, 2023. It is now read-only.
Update module github.com/ReneKroon/ttlcache to v3 #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v1.7.0
->v3.0.0
Release Notes
ReneKroon/ttlcache
v3.0.0
Compare Source
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:
Item
type that is returned by bothGet
andSet
methods.Close()
method.Purge()
method toDeleteAll()
.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.Loader
interface.All new or updated types and functions can be found on the documentation, README, or v3 issue page.
v2.11.1
Compare Source
The v2 module path has been changed.
v2.11.0
Compare Source
2.11.0 (December 2021)
#64: @DoubleDi added a method GetItems to retrieve all items in the cache. This method also triggers all callbacks associated with a normal Get
API changes:
v2.10.0
Compare Source
2.10.0 (December 2021)
#62 : @nikhilk1701 found a memory leak where removed items are not directly eligible for garbage collection. There are no API changes.
v2.9.0
Compare Source
2.9.0 (October 2021)
#55,#56,#57 : @chenyahui was on fire and greatly improved the peformance of the library. He also got rid of the blocking call to expirationNotification, making the code run twice as fast in the benchmarks!
v2.8.1
Compare Source
#53 Avoids recalculation of TTL value returned in API when TTL is extended.
v2.8.0
Compare Source
API Change
GetWithTTL(key string) (interface{}, time.Duration, error)
is added so that you can retrieve an item, and also know the remaining TTL. Thanks to @asgarciap for contributing.v2.7.0
Compare Source
#46 : got panic
A panic occured in a line that checks the maximum amount of items in the cache. While not definite root cause has been found, there is indeed the possibility of crashing an empty cache if the cache limit is set to 'zero' which codes for infinite. This would lead to removal of the first item in the cache which would panic on an empty cache.
Fixed this by applying the global cache lock to all configuration options as well.
v2.6.0
Compare Source
#44 : There are no API changes, but a contribution was made to use https://pkg.go.dev/golang.org/x/sync/singleflight as a way to provide everybody waiting for a key with that result when it is fetched. Thanks go out to @jspri
This removes some complexity from the code and will make sure that all callers will get a return value even if there's high concurrency and low TTL (as proven by the test that was added).
v2.5.0
Compare Source
API changes:
GetByLoader
Introduce the
SimpleCache
interface for quick-start and basic usage.v2.4.0
Compare Source
2.4.0 - Add some item manipulation
#42 : Add option to get list of keys
#40: Allow 'Touch' on items without other operation
v2.3.0
Compare Source
2.3.0 (February 2021)
API changes:
v2.2.0
Compare Source
2.2.0 (January 2021)
API changes:
#37 : a
GetMetrics
call is now available for some information on hits/misses etc.#34 : Errors are now const
v2.1.0
Compare Source
2.1.0 (October 2020)
API changes
SetCacheSizeLimit(limit int)
a call was contributed to set a cache limit. #35v2.0.0
Compare Source
2.0.0 (July 2020)
Fixes #29, #30, #31
Behavioural changes
Remove(key)
now also calls the expiration callback when it's setCount()
returns zero when the cache is closedAPI changes
SetLoaderFunction
allows you to provide a function to retrieve data on missing cache keys.Close
,Set
,SetWithTTL
,Get
,Remove
,Purge
now return an error with standard errorsErrClosed
anErrNotFound
instead of a bool or nothingSkipTTLExtensionOnHit
replacesSkipTtlExtensionOnHit
to satisfy golintConfiguration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.