go-common/app/job/main/videoup/dao/redis/dao.go

27 lines
421 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package redis
import (
"go-common/app/job/main/videoup/conf"
xredis "go-common/library/cache/redis"
)
// Dao is redis dao.
type Dao struct {
c *conf.Config
redis *xredis.Pool
}
// New new a archive dao.
func New(c *conf.Config) (d *Dao) {
d = &Dao{
c: c,
redis: xredis.NewPool(c.Redis),
}
return d
}
// Close close the redis connection
func (d *Dao) Close() (err error) {
return d.redis.Close()
}