go_dreamfactory/sys/cache/cache.go
2022-05-30 10:34:12 +08:00

23 lines
480 B
Go

package cache
import "github.com/liwei1dao/lego/sys/redis"
func newSys(options Options) (sys *Cache, err error) {
sys = &Cache{options: options}
err = sys.init()
return
}
type Cache struct {
options Options
redis redis.ISys
}
func (this *Cache) init() (err error) {
this.redis, err = redis.NewSys(
redis.SetRedisType(redis.Redis_Cluster),
redis.Redis_Cluster_Addr(this.options.Redis_Addr),
redis.SetRedis_Cluster_Password(this.options.Redis_Password))
return
}