go-common/app/service/live/xuserex/dao/dao.go

34 lines
462 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package dao
import (
"context"
"go-common/app/service/live/xuserex/conf"
"go-common/library/cache/memcache"
)
// Dao dao
type Dao struct {
c *conf.Config
mc *memcache.Pool
}
// New init mysql db
func New(c *conf.Config) (dao *Dao) {
dao = &Dao{
c: c,
mc: memcache.NewPool(c.Memcache),
}
return
}
// Close close the resource.
func (d *Dao) Close() {
d.mc.Close()
}
// Ping dao ping
func (d *Dao) Ping(c context.Context) error {
return nil
}