dao

package
v0.0.0-...-83adff0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromError

func PromError(name string)

PromError prom error

func PromInfo

func PromInfo(name string)

PromInfo add prom info

Types

type Dao

type Dao struct {
	// contains filtered or unexported fields
}

Dao .

func New

func New(c *conf.Config) (d *Dao)

New new dao.

func (*Dao) AddCDCache

func (d *Dao) AddCDCache(ctx context.Context, app, mid int64) (err error)

AddCDCache adds cd cache.

func (*Dao) AddTask

func (d *Dao) AddTask(ctx context.Context, t *pushmdl.Task) (id int64, err error)

AddTask adds task.

func (*Dao) AddUUIDCache

func (d *Dao) AddUUIDCache(c context.Context, biz int64, uuid string) (err error)

AddUUIDCache adds uuid cache.

func (*Dao) Apps

func (d *Dao) Apps(ctx context.Context) (res map[int64]*pushmdl.APP, err error)

Apps get all app info

func (*Dao) BeginTx

func (d *Dao) BeginTx(ctx context.Context) (*xsql.Tx, error)

BeginTx begin transaction.

func (*Dao) Businesses

func (d *Dao) Businesses(ctx context.Context) (res map[int64]*pushmdl.Business, err error)

Businesses gets all business info.

func (*Dao) Close

func (d *Dao) Close()

Close .

func (*Dao) DelUUIDCache

func (d *Dao) DelUUIDCache(c context.Context, biz int64, uuid string) (err error)

DelUUIDCache delete uuid cache.

func (*Dao) ExistsCDCache

func (d *Dao) ExistsCDCache(ctx context.Context, app, mid int64) (exist bool, err error)

ExistsCDCache gets cd from cache.

func (*Dao) ExistsUUIDCache

func (d *Dao) ExistsUUIDCache(c context.Context, biz int64, uuid string) (exist bool, err error)

ExistsUUIDCache gets uuid from cache.

func (*Dao) IncrLimitBizCache

func (d *Dao) IncrLimitBizCache(ctx context.Context, day string, app, mid, biz int64) (count int, err error)

IncrLimitBizCache increases and gets limit cache by day & mid & bisiness.

func (*Dao) IncrLimitDayCache

func (d *Dao) IncrLimitDayCache(ctx context.Context, day string, app, mid int64) (count int, err error)

IncrLimitDayCache increases and gets limit cache by day & mid.

func (*Dao) IncrLimitNotLiveCache

func (d *Dao) IncrLimitNotLiveCache(ctx context.Context, day string, mid int64) (count int, err error)

IncrLimitNotLiveCache increases and gets not live limit cache by day & mid.

func (*Dao) LimitDayCache

func (d *Dao) LimitDayCache(ctx context.Context, day string, app, mid int64) (count int, err error)

LimitDayCache gets limit cache by day & mid. 测试用,业务用不着

func (*Dao) MaxSettingID

func (d *Dao) MaxSettingID(ctx context.Context) (id int64, err error)

MaxSettingID gets max setting id in DB.

func (*Dao) Ping

func (d *Dao) Ping(ctx context.Context) (err error)

Ping .

func (*Dao) SendWechat

func (d *Dao) SendWechat(msg string) (err error)

SendWechat 发送企业微信消息

func (*Dao) SettingsByRange

func (d *Dao) SettingsByRange(ctx context.Context, start, end int64) (res map[int64]map[int]int, err error)

SettingsByRange gets user setting by range.

func (*Dao) Task

func (d *Dao) Task(ctx context.Context, id int64) (t *pushmdl.Task, err error)

Task loads task by id.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL