Releases: TwiN/gocache
v1.2.2
v1.2.1
v1.2.0
v1.1.0
- 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
v0.4.2
v0.4.1
v0.4.0
- (BREAKING) Renamed
GetAll
toGetByKeys
and addGetAll
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
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
andused_memory_dataset_human
toINFO
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
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
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.