dao.go 415 B

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