init.go
662 字节
package redis
import (
"github.com/tiptok/gocomm/pkg/cache"
"github.com/tiptok/gocomm/pkg/cache/gzcache"
"github.com/tiptok/gocomm/pkg/log"
"gitlab.fjmaimaimai.com/mmm-go-pp/partner01/pkg/constant"
)
func init() {
//redisSource := fmt.Sprintf("%v:%v", constant.REDIS_HOST, constant.REDIS_PORT)
//err := redis.InitWithDb(100, redisSource, constant.REDIS_AUTH, "0")
//if err != nil {
// log.Error(err)
//}
//cache.InitDefault(cache.WithDefaultRedisPool(redis.GetRedisPool()))
cache.InitMultiLevelCache(cache.WithDebugLog(true, log.Logger))
cache.RegisterCache(gzcache.NewNodeCache(constant.REDIS_HOST+":"+constant.REDIS_PORT, constant.REDIS_AUTH))
}