All Versions
18
Latest Version
Avg Release Cycle
142 days
Latest Release
141 days ago

Changelog History
Page 1

  • v2.7.0 Changes

    June 01, 2021

    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 Changes

    May 01, 2021

    ๐Ÿ”€ #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 key when it's fetched.

    ๐Ÿšš 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 Changes

    May 01, 2021

    API changes:

    • #39 : Allow custom loader function for each key via GetByLoader

    Introduce the SimpleCache interface for quick-start and basic usage.

  • v2.4.0 Changes

    April 01, 2021

    API changes:

    • #42 : Add option to get list of keys
    • #40: Allow 'Touch' on items without other operation

    // Touch resets the TTL of the key when it exists, returns ErrNotFound if the key is not present. func (cache *Cache) Touch(key string) error

    // GetKeys returns all keys of items in the cache. Returns nil when the cache has been closed. func (cache *Cache) GetKeys() []string

  • v2.3.0 Changes

    February 01, 2021

    API changes:

    • #38: Added func (cache *Cache) SetExpirationReasonCallback(callback ExpireReasonCallback) This wil function will replace SetExpirationCallback(..) in the next major version.
  • v2.2.0 Changes

    January 01, 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 Changes

    October 01, 2020

    2.1.0 (October 2020)

    API changes

    • SetCacheSizeLimit(limit int) a call was contributed to set a cache limit. #35
  • v2.0.0 Changes

    July 01, 2020

    2.0.0 (July 2020)

    ๐Ÿ›  Fixes #29, #30, #31

    Behavioural changes

    • ๐Ÿšš Remove(key) now also calls the expiration callback when it's set
    • Count() returns zero when the cache is closed

    API changes

    • SetLoaderFunction allows you to provide a function to retrieve data on missing cache keys.
    • ๐Ÿšš Operations that affect item behaviour such as Close, Set, SetWithTTL, Get, Remove, Purge now return an error with standard errors ErrClosed an ErrNotFound instead of a bool or nothing
    • ๐Ÿ‘• SkipTTLExtensionOnHit replaces SkipTtlExtensionOnHit to satisfy golint
    • The callback types are now exported
  • v1.7.0 Changes

    July 22, 2020

    ๐Ÿš€ This release has two points:

    • โœ‚ Remove vendoring and continue with modules only. I consider this not breaking as this is a possibility since Go 1.11 and is not an issue on the current Go 1.13 and 1.14 build.
    • ๐Ÿ›  Fixed issue #28: call expirationCallback automatically on cache.Close()

    Note that while all expirationCallback routines are called for all items in the cache on cache.Close() there is no synchronized wait. This is the current behavior for expiration at runtime. It's up to the cache creator to decide whether to built in synchronization for a full clean shutdown. See TestCache_ExpirationOnClose(t *testing.T) for a sample with synchronization.

  • v1.6.0 Changes

    October 15, 2019

    In issue #23 it became clear that people want create and drop caches on the fly. There was a goroutine leak in that case.

    • ๐Ÿ›  The goroutine leak is fixed, after calling Close, an empty cache remains.
    • โœ… Tests are now done with uber goroutine leak detector.
    • โœ… Test logging has been cleaned.
    • ๐Ÿ— 100% coverage, not by synthetic testing but by building up the test suite with seen issues over time.