dao.go 402 B

123456789101112131415161718192021222324
  1. package audit
  2. import (
  3. "go-common/app/interface/main/tv/conf"
  4. "go-common/library/cache/memcache"
  5. "go-common/library/database/sql"
  6. )
  7. // Dao is account dao.
  8. type Dao struct {
  9. mc *memcache.Pool
  10. conf *conf.Config
  11. db *sql.DB
  12. }
  13. // New account dao.
  14. func New(c *conf.Config) (d *Dao) {
  15. d = &Dao{
  16. conf: c,
  17. mc: memcache.NewPool(c.Memcache.Config),
  18. db: sql.NewMySQL(c.Mysql),
  19. }
  20. return
  21. }