-
Clone the repository.
go get github.com/guaidashu/go_proc_cache.git
go_proc_cache.InitProcCache(100)
key := "custom key"
result, _ := go_proc_cache.ProcCache.Get(key, func() (interface{}, error) {
var data type(any type)
// do something
return data, nil
}, expired(expired time,example:time.Second*5))
if err != nil {
log.Println("get cache data err: ", err)
}
Contact to me with email "1023767856@qq.com" or "song42960@gmail.com"
Add files to /test and run it.