Skip to content

Commit c056e59

Browse files
committed
Readme
1 parent 5d6f09a commit c056e59

File tree

1 file changed

+15
-24
lines changed

1 file changed

+15
-24
lines changed

README.md

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,25 @@ Core use for this projet are **BuntDB**
88
Very simple.
99

1010
```golang
11-
package main
12-
13-
import (
14-
"github.com/thiagozs/go-cache/v1/cache"
15-
)
16-
17-
func main() {
18-
println("Hello, world!")
19-
20-
cache, err := cache.New("./db", "db.db", 200, false)
21-
if err != nil {
22-
println(err)
23-
}
24-
if err := cache.WriteKeyVal("key", "value"); err != nil {
25-
println(err)
26-
return
27-
}
28-
29-
rr, err := cache.GetVal("key")
30-
if err != nil {
31-
println(err)
32-
return
33-
}
34-
println(rr)
11+
cache, err := cache.New(drivers.BUNTDB, opts...)
12+
if err != nil {
13+
fmt.Println("Error:", err)
14+
return
15+
}
16+
17+
cache.WriteKeyVal("key1", "value1")
18+
cache.WriteKeyVal("key2", "value2")
19+
20+
v1, err := cache.GetVal("key1")
21+
if err != nil {
22+
fmt.Println("Error:", err)
23+
return
3524
}
3625

3726
```
3827

28+
A example of a cache implementation. You can find it in the `examples` folder.
29+
3930
## Versioning and license
4031

4132
Our version numbers follow the [semantic versioning specification](http://semver.org/). You can see the available versions by checking the [tags on this repository](https://github.com/thiagozs/go-cache/tags). For more details about our license model, please take a look at the [LICENSE](LICENSE) file.

0 commit comments

Comments
 (0)