File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,21 @@ go-generics-cache is an in-memory key:value store/cache that is suitable for app
6
6
7
7
- a thread-safe
8
8
- implemented with [ Go Generics] ( https://go.dev/blog/generics-proposal )
9
- - Simple cache is like ` map[string]interface{} ` with expiration times
9
+ - TTL supported (with expiration times)
10
+ - Simple cache is like ` map[string]interface{} `
10
11
- See [ examples] ( https://github.com/Code-Hex/go-generics-cache/blob/main/simple/example_test.go )
11
- - LRU cache
12
- - See [ examples] ( https://github.com/Code-Hex/go-generics-cache/blob/main/lru/example_test.go )
13
- - LFU cache
14
- - See [ examples] ( https://github.com/Code-Hex/go-generics-cache/blob/main/lfu/example_test.go )
15
- - [ An O(1) algorithm for implementing the LFU cache eviction scheme] ( http://dhruvbird.com/lfu.pdf )
12
+ - Cache replacement policies
13
+ - Least recently used (LRU)
14
+ - Discards the least recently used items first.
15
+ - See [ examples] ( https://github.com/Code-Hex/go-generics-cache/blob/main/lru/example_test.go )
16
+ - Least-frequently used (LFU)
17
+ - Counts how often an item is needed. Those that are used least often are discarded first.
18
+ - [ An O(1) algorithm for implementing the LFU cache eviction scheme] ( http://dhruvbird.com/lfu.pdf )
19
+ - See [ examples] ( https://github.com/Code-Hex/go-generics-cache/blob/main/lfu/example_test.go )
20
+ - First in first out (FIFO)
21
+ - Using this algorithm the cache behaves in the same way as a [ FIFO queue] ( https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics) ) .
22
+ - The cache evicts the blocks in the order they were added, without any regard to how often or how many times they were accessed before.
23
+ - See [examples](https://github.com/Code-Hex/go-generics-cache/blob/main/fifo/example_test.go)
16
24
17
25
## Requirements
18
26
You can’t perform that action at this time.
0 commit comments