proxy.golang.org : 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.
Registry
-
Source
- Documentation
- JSON
- codemeta.json
purl: pkg:golang/github.com/gozeloglu/cache
Keywords:
cache
, go
, go-package
, golang
, lru
, lru-cache
License: MIT
Latest release: about 4 years ago
First release: about 4 years ago
Namespace: github.com/gozeloglu
Stars: 26 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: about 2 months ago