github.com/gozeloglu/cache
Package cache is a cache package written in Go with no dependency. It uses Least-Recently Used (LRU) algorithm for replacement policy. Behind the package, it uses doubly-linked list which is built-in data structure that comes from container/list. Any data can be stored in cache. Firstly, you need to create a new cache as follows. It takes one parameter that is capacity of the cache. For the example, the cache can keep up to 5 data. If a new data is being tried to add when the cache is full, the gcache removes the least-recently used one and adds the new data.
Ecosystem
proxy.golang.org
proxy.golang.org
Latest Release
about 4 years ago
v0.7.1
about 4 years ago
Versions
8
8
Links
| Registry | proxy.golang.org |
| Source | Repository |
| Docs | Documentation |
| JSON API | View JSON |
| CodeMeta | codemeta.json |
Package Details
| PURL |
pkg:golang/github.com/gozeloglu/cache
spec |
| License | MIT |
| Namespace | github.com/gozeloglu |
| First Release | over 4 years ago |
| Last Synced | 22 days ago |
Repository
| Stars | 26 on GitHub |
| Forks | 0 on GitHub |
Rankings on proxy.golang.org
Overall
Top 8.2%