dao.go 421 B

1234567891011121314151617181920212223242526
  1. package redis
  2. import (
  3. "go-common/app/job/main/videoup/conf"
  4. xredis "go-common/library/cache/redis"
  5. )
  6. // Dao is redis dao.
  7. type Dao struct {
  8. c *conf.Config
  9. redis *xredis.Pool
  10. }
  11. // New new a archive dao.
  12. func New(c *conf.Config) (d *Dao) {
  13. d = &Dao{
  14. c: c,
  15. redis: xredis.NewPool(c.Redis),
  16. }
  17. return d
  18. }
  19. // Close close the redis connection
  20. func (d *Dao) Close() (err error) {
  21. return d.redis.Close()
  22. }