File tree Expand file tree Collapse file tree 1 file changed +48
-1
lines changed Expand file tree Collapse file tree 1 file changed +48
-1
lines changed Original file line number Diff line number Diff line change 1
1
# lcache
2
- A simple LRU based cache in Go
2
+
3
+ Cache library for golang. It supports LFU currently.
4
+
5
+ ## Features
6
+
7
+ * Supports LFU.
8
+
9
+ * Goroutine safe.
10
+
11
+ ## Install
12
+
13
+ ```
14
+ $ go get github.com/solutionstack/lcache
15
+ ```
16
+
17
+ ## Example
18
+
19
+ ### Set a key-value pair.
20
+
21
+ ``` go
22
+ package main
23
+
24
+ import (
25
+ " github.com/solutionstack/lcache"
26
+ " fmt"
27
+ )
28
+
29
+ func main () {
30
+ lc := lcache.NewCache (20 ) // optional size parameter to NewCache
31
+ lc.Write (" key" , " ok" )
32
+
33
+ result := gc.Read (" key" )
34
+
35
+ if result.Error != nil {
36
+ panic ( result.Error )
37
+ }
38
+ fmt.Println (" Read:" , result.Value )
39
+ }
40
+
41
+ ```
42
+
43
+
44
+ # Author
45
+
46
+ ** Olubodn Agbalaya**
47
+
48
+ * < http://github.com/solutionstack >
49
+ * <s.stackng@protonmail.com >
You can’t perform that action at this time.
0 commit comments