dao.go 516 B

123456789101112131415161718192021222324252627
  1. package report
  2. import (
  3. "go-common/app/job/main/tv/conf"
  4. "go-common/library/cache/memcache"
  5. "go-common/library/database/sql"
  6. bm "go-common/library/net/http/blademaster"
  7. )
  8. // Dao dao .
  9. type Dao struct {
  10. conf *conf.Config
  11. httpR *bm.Client
  12. mc *memcache.Pool
  13. DB *sql.DB
  14. }
  15. // New create a instance of Dao and return .
  16. func New(c *conf.Config) (d *Dao) {
  17. d = &Dao{
  18. conf: c,
  19. httpR: bm.NewClient(c.DpClient),
  20. mc: memcache.NewPool(c.Memcache.Config),
  21. DB: sql.NewMySQL(c.Mysql),
  22. }
  23. return
  24. }