dao.go 435 B

12345678910111213141516171819202122232425
  1. package archive
  2. import (
  3. "time"
  4. "go-common/app/job/main/tv/conf"
  5. "go-common/library/cache/memcache"
  6. )
  7. // Dao is archive dao.
  8. type Dao struct {
  9. // memcache
  10. mc *memcache.Pool
  11. expireView int32
  12. }
  13. // New new a archive dao.
  14. func New(c *conf.Config) (d *Dao) {
  15. d = &Dao{
  16. // memcache
  17. mc: memcache.NewPool(c.Memcache.Config),
  18. expireView: int32(time.Duration(c.Memcache.ExpireMedia) / time.Second),
  19. }
  20. return
  21. }