go-common/app/job/main/feed/dao/dao.go

40 lines
631 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package dao
import (
"context"
"go-common/app/job/main/feed/conf"
bm "go-common/library/net/http/blademaster"
"go-common/library/stat/prom"
)
var (
infosCount = prom.BusinessInfoCount
)
// Dao is feed job dao.
type Dao struct {
c *conf.Config
smsClient *bm.Client
}
// New add a feed job dao.
func New(c *conf.Config) *Dao {
return &Dao{
c: c,
smsClient: bm.NewClient(c.HTTPClient),
}
}
func (d *Dao) Ping(c context.Context) (err error) {
return
}
func PromError(name string) {
prom.BusinessErrCount.Incr(name)
}
// PromInfo add prom info
func PromInfo(name string) {
infosCount.Incr(name)
}