Skip to content

Releases: TwiN/gocache

v1.2.2

06 Jun 18:49
cbb4191
Compare
Choose a tag to compare
  • Restructured server packages
  • Improved documentation

v1.2.1

06 Feb 03:07
Compare
Choose a tag to compare

Replaced bolt by bbolt for persistence

v1.2.0

02 Feb 01:31
Compare
Choose a tag to compare

Added Cache.GetValue

v1.1.0

11 Jan 05:12
Compare
Choose a tag to compare
  • Added Cache.WithForceNilInterfaceOnNilPointer

In Go, an interface is only nil if both its type and value are nil, which means that a nil pointer
(e.g. (*Struct)(nil)) retains its type when passed as an interface{}, and the unmodified value returned from
Cache.Get, for instance, would return false when compared with nil.

This new configuration allows a cache to bypass that counter-intuitive behavior by setting the value to nil if a nil pointer is passed as the value parameter to a write function (Set, SetWithTTL and SetAll), which effectively sets both the type and the value of the cache entry to nil, thus allowing the statement value == nil to be true.

The default value for that new configuration is true, because this behavior is more intuitive.

v1.0.0

06 Jan 06:19
Compare
Choose a tag to compare
  • (BREAKING) Cache.Stats() no longer returns a pointer
  • Fixed race conditions

v0.4.2

06 Jan 03:53
Compare
Choose a tag to compare

Fixed issue with Cache.Stats().ExpiredKeys not incrementing on active deletion of expired keys

v0.4.1

06 Jan 03:14
Compare
Choose a tag to compare
  • GetKeysByPattern no longer returns expired keys
  • Fixed issue caused by calling StopJanitor when the janitor wasn't started

v0.4.0

01 Jan 00:35
Compare
Choose a tag to compare
  • (BREAKING) Renamed GetAll to GetByKeys and add GetAll function
  • Significantly improved test coverage
  • Improved documentation

I don't make it a habit of making breaking changes, especially without increasing the major version in the tag, but since there are very few people using this library, I'll make an exception.

v0.3.0

28 Oct 22:42
Compare
Choose a tag to compare

gocache

  • Added stats on cache hits and cache misses
  • Switched to Bolt for persistence to reduce peak memory usage on save #3
  • RelevantTimestamp is now updated when an existing entry is modified

gocacheserver

  • Added logs during auto saves
  • Added used_memory, used_memory_human, used_memory_dataset and used_memory_dataset_human to INFO output

The switch to Bolt is a breaking change, but since this library isn't used by many at the moment - much less the persistence feature - not updating the major version should be acceptable.

v0.2.0

26 Oct 05:16
Compare
Choose a tag to compare

gocache

  • Implemented eviction based on maximum memory usage #2 #4
  • Fields of the Cache struct are now exposed through functions rather than being directly accessible

gocacheserver

  • Implemented eviction based on maximum memory usage #2 #4

The last change of the gocache section is a breaking change, but considering the meager popularity of the repository at the moment, not updating the major version should be acceptable.