gocache

High performance and lightweight in-memory cache library with LRU and FIFO support as well as memory-usage-based-eviction

MIT License

Stars
34

Bot releases are hidden (Show)

gocache - v2.2.2 Latest Release

Published by TwiN 7 months ago

What's Changed

  • chore: Bump Go to 1.21

Full Changelog: https://github.com/TwiN/gocache/compare/v2.2.1...v2.2.2

gocache - v2.2.1

Published by TwiN 7 months ago

What's Changed

  • chore: Bump Go to 1.20

Full Changelog: https://github.com/TwiN/gocache/compare/v2.2.0...v2.2.1

gocache - v2.2.0

Published by TwiN almost 2 years ago

What's Changed

Full Changelog: https://github.com/TwiN/gocache/compare/v2.1.2...v2.2.0

gocache - v2.1.2

Published by TwiN almost 2 years ago

What's Changed

Full Changelog: https://github.com/TwiN/gocache/compare/v2.1.1...v2.1.2

gocache - v2.1.1

Published by TwiN about 2 years ago

chore: Update Go to 1.19

gocache - v2.1.0

Published by TwiN about 2 years ago

feat: Add DeleteKeysByPattern method

gocache - v2.0.1

Published by TwiN over 2 years ago

  • chore: Update Go to 1.18
  • fix: Delete empty go.sum
  • fix: Increment miss cache stats before unlocking the mutex
gocache - v2.0.0

Published by TwiN almost 3 years ago

  • Removed persistence features #6
  • Removed server features #6

As of now, this library is strictly an in-memory cache and has 0 dependencies.

This is a breaking change, therefore the version is going from v1.x to v2.x

gocache - v1.2.4

Published by TwiN about 3 years ago

gocache - v1.2.3

Published by TwiN over 3 years ago

Minor fixes

gocache - v1.2.2

Published by TwiN over 3 years ago

  • Restructured server packages
  • Improved documentation
gocache - v1.2.1

Published by TwiN over 3 years ago

Replaced bolt by bbolt for persistence

gocache - v1.2.0

Published by TwiN over 3 years ago

Added Cache.GetValue

gocache - v1.1.0

Published by TwiN almost 4 years ago

  • 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.

gocache - v1.0.0

Published by TwiN almost 4 years ago

  • (BREAKING) Cache.Stats() no longer returns a pointer
  • Fixed race conditions
gocache - v0.4.2

Published by TwiN almost 4 years ago

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

gocache - v0.4.1

Published by TwiN almost 4 years ago

  • GetKeysByPattern no longer returns expired keys
  • Fixed issue caused by calling StopJanitor when the janitor wasn't started
gocache - v0.4.0

Published by TwiN almost 4 years ago

  • (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.

gocache - v0.3.0

Published by TwiN almost 4 years ago

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.

gocache - v0.2.0

Published by TwiN almost 4 years ago

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.

Package Rankings
Top 4.3% on Proxy.golang.org
Badges
Extracted from project README
Go Report Card codecov Go version Go Reference Follow TwiN