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: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromError

func PromError(name string)

PromError prometheus error count.

func PromInfo

func PromInfo(name string)

PromInfo prometheus info count.

Types

type Dao

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

Dao .

func New

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

New creates a dao instance.

func (*Dao) AddTask

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

AddTask adds task

func (*Dao) BeginTx

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

BeginTx begin transaction.

func (*Dao) Close

func (d *Dao) Close()

Close .

func (*Dao) DelCallbacks

func (d *Dao) DelCallbacks(c context.Context, t time.Time, limit int) (rows int64, err error)

DelCallbacks deletes callbacks.

func (*Dao) DelTasks

func (d *Dao) DelTasks(c context.Context, t time.Time, limit int) (rows int64, err error)

DelTasks deletes tasks.

func (*Dao) DpCheckJob

func (d *Dao) DpCheckJob(ctx context.Context, url string) (res *model.DpCheckJobResult, err error)

DpCheckJob .

func (*Dao) DpDownloadFile

func (d *Dao) DpDownloadFile(ctx context.Context, url string) (content []byte, err error)

DpDownloadFile .

func (*Dao) DpSubmitQuery

func (d *Dao) DpSubmitQuery(ctx context.Context, query string) (statusRUL string, err error)

DpSubmitQuery .

func (*Dao) Ping

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

Ping reports the health of the db/cache etc.

func (*Dao) ReportLastID

func (d *Dao) ReportLastID(c context.Context) (id int64, err error)

ReportLastID gets the latest ID of report database record.

func (*Dao) ReportsByRange

func (d *Dao) ReportsByRange(c context.Context, min, max int64) (rs []*pushmdl.Report, err error)

ReportsByRange gets reports by id range.

func (*Dao) ReportsCacheByMids

func (d *Dao) ReportsCacheByMids(c context.Context, mids []int64) (res map[int64][]*pushmdl.Report, missed []int64, err error)

ReportsCacheByMids get report cache by mids.

func (*Dao) ReportsTaskAll

func (d *Dao) ReportsTaskAll(c context.Context, min, max, app int64) (rows *xsql.Rows, err error)

ReportsTaskAll gets reports by range

func (*Dao) SendWechat

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

SendWechat 发送企业微信消息

func (*Dao) TxCondByStatus

func (d *Dao) TxCondByStatus(tx *xsql.Tx, status int) (cond *pamdl.DPCondition, err error)

TxCondByStatus gets condition by status.

func (*Dao) TxTaskByStatus

func (d *Dao) TxTaskByStatus(tx *xsql.Tx, status int8) (t *pushmdl.Task, err error)

TxTaskByStatus gets task by status by tx.

func (*Dao) TxUpdateCondStatus

func (d *Dao) TxUpdateCondStatus(tx *xsql.Tx, id int64, status int) (err error)

TxUpdateCondStatus update data platform query condition status

func (*Dao) TxUpdateTaskStatus

func (d *Dao) TxUpdateTaskStatus(tx *xsql.Tx, taskID string, status int8) (err error)

TxUpdateTaskStatus updates task status by tx.

func (*Dao) UpdateDpCond

func (d *Dao) UpdateDpCond(ctx context.Context, cond *pamdl.DPCondition) (err error)

UpdateDpCond update data platform query condition

func (*Dao) UpdateDpCondStatus

func (d *Dao) UpdateDpCondStatus(ctx context.Context, id int64, status int) (err error)

UpdateDpCondStatus update data platform query condition

func (*Dao) UpdateTask

func (d *Dao) UpdateTask(c context.Context, taskID string, file string, status int8) (err error)

UpdateTask update task.

func (*Dao) UpdateTaskStatus

func (d *Dao) UpdateTaskStatus(c context.Context, taskID int64, status int8) (err error)

UpdateTaskStatus update task status.

Jump to

Keyboard shortcuts

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