dao.go 631 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/job/main/feed/conf"
  5. bm "go-common/library/net/http/blademaster"
  6. "go-common/library/stat/prom"
  7. )
  8. var (
  9. infosCount = prom.BusinessInfoCount
  10. )
  11. // Dao is feed job dao.
  12. type Dao struct {
  13. c *conf.Config
  14. smsClient *bm.Client
  15. }
  16. // New add a feed job dao.
  17. func New(c *conf.Config) *Dao {
  18. return &Dao{
  19. c: c,
  20. smsClient: bm.NewClient(c.HTTPClient),
  21. }
  22. }
  23. func (d *Dao) Ping(c context.Context) (err error) {
  24. return
  25. }
  26. func PromError(name string) {
  27. prom.BusinessErrCount.Incr(name)
  28. }
  29. // PromInfo add prom info
  30. func PromInfo(name string) {
  31. infosCount.Incr(name)
  32. }