Skip to content

Commit

Permalink
Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagozs committed Nov 25, 2021
1 parent 5d6f09a commit c056e59
Showing 1 changed file with 15 additions and 24 deletions.
39 changes: 15 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,25 @@ Core use for this projet are **BuntDB**
Very simple.

```golang
package main

import (
"github.com/thiagozs/go-cache/v1/cache"
)

func main() {
println("Hello, world!")

cache, err := cache.New("./db", "db.db", 200, false)
if err != nil {
println(err)
}
if err := cache.WriteKeyVal("key", "value"); err != nil {
println(err)
return
}

rr, err := cache.GetVal("key")
if err != nil {
println(err)
return
}
println(rr)
cache, err := cache.New(drivers.BUNTDB, opts...)
if err != nil {
fmt.Println("Error:", err)
return
}

cache.WriteKeyVal("key1", "value1")
cache.WriteKeyVal("key2", "value2")

v1, err := cache.GetVal("key1")
if err != nil {
fmt.Println("Error:", err)
return
}

```

A example of a cache implementation. You can find it in the `examples` folder.

## Versioning and license

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.
Expand Down

0 comments on commit c056e59

Please sign in to comment.