init.go
554 字节
package redis
import (
ilog "github.com/linmadan/egglib-go/log"
"github.com/linmadan/egglib-go/persistent/cache"
"github.com/linmadan/egglib-go/persistent/cache/gzcache"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log"
)
func init() {
cache.NewDefaultCache(cache.WithDebugLog(true, func() ilog.Logger { return log.Logger }))
cache.RegisterCache(gzcache.NewNodeCache(constant.REDIS_HOST+":"+constant.REDIS_PORT, constant.REDIS_AUTH))
}