https://github.com/tynovsky/cachier
Golang cache interface
https://github.com/tynovsky/cachier
cache go golang golang-library interface
Last synced: over 1 year ago
JSON representation
Golang cache interface
- Host: GitHub
- URL: https://github.com/tynovsky/cachier
- Owner: tynovsky
- License: mit
- Created: 2019-02-25T11:15:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-25T11:59:15.000Z (over 7 years ago)
- Last Synced: 2025-02-16T03:45:04.648Z (over 1 year ago)
- Topics: cache, go, golang, golang-library, interface
- Language: Go
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/tynovsky/cachier)
[](https://godoc.org/github.com/tynovsky/cachier)
# Cachier
Cachier is a Go library that provides an interface for dealing with cache.
There is a CacheEngine interface which requires you to implement common cache
methods (like Get, Set, Delete, etc). When implemented, you wrap this
CacheEngine into the Cache struct. This struct has some methods implemented
like GetOrCompute method (shortcut for fetching a hit or computing/writing
a miss).
There are also three implementations included:
- LRUCache: a wrapper of hashicorp/golang-lru which fulfills the CacheEngine
interface
- RedisCache: CacheEngine based on redis
- CacheWithSubcache: Implementation of combination of primary cache with fast
L1 subcache. E.g. primary Redis cache and fast (and small) LRU subcache.
But any other implementations of CacheEngine can be used.