https://github.com/xiaojiaoyu100/roc
KV Memory Cache
https://github.com/xiaojiaoyu100/roc
go memorycache
Last synced: about 1 month ago
JSON representation
KV Memory Cache
- Host: GitHub
- URL: https://github.com/xiaojiaoyu100/roc
- Owner: xiaojiaoyu100
- License: mit
- Created: 2019-08-12T13:00:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-14T12:17:00.000Z (over 5 years ago)
- Last Synced: 2024-06-19T16:33:08.775Z (over 1 year ago)
- Topics: go, memorycache
- Language: Go
- Homepage: https://github.com/xiaojiaoyu100/roc
- Size: 18.6 KB
- Stars: 5
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Roc
Roc is a key-value memory cache.
[](https://godoc.org/github.com/xiaojiaoyu100/roc)
## Feature
* Volatile LRU
* Quick GC
## Usage
```go
package main
import (
"fmt"
"github.com/xiaojiaoyu100/roc"
"time"
)
func main() {
cache, err := roc.New()
if err != nil {
fmt.Println(err)
return
}
if err := cache.Set("myfirstkey", "123", time.Second*3); err != nil {
fmt.Println(err)
return
}
fmt.Println(cache.Get("myfirstkey"))
fmt.Println(cache.Del("myfirstkey"))
fmt.Println(cache.Get("myfirstkey"))
}
```