dao.go 496 B

1234567891011121314151617181920212223242526272829303132333435
  1. package dao
  2. import (
  3. "context"
  4. "go-common/library/database/elastic"
  5. "go-common/app/admin/main/passport/conf"
  6. )
  7. // Dao dao
  8. type Dao struct {
  9. c *conf.Config
  10. // elastic client
  11. EsCli *elastic.Elastic
  12. }
  13. // New init mysql db
  14. func New(c *conf.Config) (dao *Dao) {
  15. dao = &Dao{
  16. c: c,
  17. // elastic client
  18. EsCli: elastic.NewElastic(c.Elastic),
  19. }
  20. return
  21. }
  22. // Close close the resource.
  23. func (d *Dao) Close() {
  24. }
  25. // Ping dao ping
  26. func (d *Dao) Ping(c context.Context) error {
  27. return nil
  28. }