兜底缓存, 在分布式缓存挂了之后会自动切换为内存做缓存。
Install KVDecorator using the "go get" command:
go get github.com/FastSchnell/KVDecorator/kv
import "KVDecorator/kv"
func testKV() {
KV.InitLocalKV()
KV.Put("a", "b", time.Second)
val, _ := KV.Get("a")
}
KVDecorator is available under the Apache License, Version 2.0.