Package mcache provides a thread-safe in-memory cache, for the Go programming language.
- Go 100%
| cacher.go | ||
| go.mod | ||
| go.sum | ||
| hash.go | ||
| hash_test.go | ||
| LICENSE | ||
| newttl.go | ||
| newttl_test.go | ||
| README.md | ||
| shardnumber.go | ||
| ttlcache.go | ||
| ttlcache_setgetunset_test.go | ||
| ttlcache_vacuum_test.go | ||
| ttlcacher.go | ||
| ttlshard.go | ||
go-mcache
Package mcache provides a thread-safe in-memory cache, for the Go programming language.
Documention
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-mcache
Examples
Here is an example of using mcache:
import "github.com/reiver/go-mcache"
// ...
var defaultTTL time.Duration = 5 * time.Minute
cache := mcache.NewTTL[Type](defaultTTL)
if nil == cache {
return errors.New("nil cache")
}
// ...
cache.Set(key, value)
// ...
val, found := cache.Get(name)
Import
To import package mcache use import code like the following:
import "github.com/reiver/go-mcache"
Installation
To install package mcache do the following:
GOPROXY=direct go get github.com/reiver/go-mcache
Author
Package mcache was written by Charles Iliya Krempeaux