Skip to content

Commit eb50166

Browse files
committed
update readme
1 parent 5042bec commit eb50166

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,49 @@
11
# 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>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy