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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

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

Dao dao

func New

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

New init mysql db

func (*Dao) AssignTask

func (d *Dao) AssignTask(c context.Context, task *model.Task) (rows int64, err error)

AssignTask .

func (*Dao) CheckFlow

func (d *Dao) CheckFlow(c context.Context, rid, flowid int64) (ok bool, err error)

CheckFlow 检查资源是否在对应流程上

func (*Dao) CheckTask

func (d *Dao) CheckTask(c context.Context, flowid, rid int64) (id int64)

CheckTask 某资源存在未完成任务,不重复添加

func (*Dao) Close

func (d *Dao) Close()

Close close the resource.

func (*Dao) CreateTask

func (d *Dao) CreateTask(c context.Context, task *model.Task) error

CreateTask .

func (*Dao) CreateUnionSet

func (d *Dao) CreateUnionSet(c context.Context, businessID, flowID int64) (err error)

CreateUnionSet 创建分身集合

func (*Dao) DeleteUinonSet

func (d *Dao) DeleteUinonSet(c context.Context, businessID, flowID int64) (err error)

DeleteUinonSet 清空分身

func (*Dao) FansCount

func (d *Dao) FansCount(c context.Context, mid int64) (fans int64, err error)

FansCount 粉丝数

func (*Dao) FlushReport

func (d *Dao) FlushReport(c context.Context) (data map[string][]byte, err error)

FlushReport .

func (*Dao) GetTask

func (d *Dao) GetTask(c context.Context, id int64) (task *model.Task, err error)

GetTask .

func (*Dao) GetWeight

func (d *Dao) GetWeight(c context.Context, businessID, flowID int64, id int64) (weight int64, err error)

GetWeight get Weight

func (*Dao) IncresByField

func (d *Dao) IncresByField(c context.Context, bizid, flowid, uid int64, field string, value int64) (err error)

IncresByField .

func (*Dao) IncresTaskInOut

func (d *Dao) IncresTaskInOut(c context.Context, bizid, flowid int64, inOrOut string) (err error)

IncresTaskInOut 总进审量-出审量

func (*Dao) IsConsumerOn

func (d *Dao) IsConsumerOn(c context.Context, bizid, flowid int, uid int64) (isOn bool, err error)

IsConsumerOn .

func (*Dao) KickOutConsumer

func (d *Dao) KickOutConsumer(c context.Context, bizid, flowid, uid int64) (err error)

KickOutConsumer 踢出用户

func (*Dao) Ping

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

Ping dao ping

func (*Dao) PushDelayTask

func (d *Dao) PushDelayTask(c context.Context, businessID, flowID int64, uid, taskid int64) (err error)

PushDelayTask 延迟任务队列

func (*Dao) PushPersonalTask

func (d *Dao) PushPersonalTask(c context.Context, businessID, flowID int64, uid, taskid int64) (err error)

PushPersonalTask 放入本人任务池

func (*Dao) PushPublicTask

func (d *Dao) PushPublicTask(c context.Context, tasks ...*model.Task) (err error)

PushPublicTask 放入实时任务池

func (*Dao) QueryTask

func (d *Dao) QueryTask(c context.Context, state int8, mtime time.Time, id, limit int64) (tasks []*model.Task, lastid int64, err error)

QueryTask .

func (*Dao) RangeUinonSet

func (d *Dao) RangeUinonSet(c context.Context, businessID, flowID int64, start, stop int64) (wis []*model.WeightItem, err error)

RangeUinonSet 批次取出

func (*Dao) ReleaseByConsumer

func (d *Dao) ReleaseByConsumer(c context.Context, bizid, flowid, uid int64) (err error)

ReleaseByConsumer .

func (*Dao) RemoveDelayTask

func (d *Dao) RemoveDelayTask(c context.Context, businessID, flowID int64, uid, taskid int64) (err error)

RemoveDelayTask 延迟任务完成

func (*Dao) RemovePersonalTask

func (d *Dao) RemovePersonalTask(c context.Context, businessID, flowID int64, uid, taskid int64) (err error)

RemovePersonalTask 任务延迟或完成

func (*Dao) RemovePublicTask

func (d *Dao) RemovePublicTask(c context.Context, businessID, flowID int64, taskid int64) (err error)

RemovePublicTask 移除

func (*Dao) Report

func (d *Dao) Report(c context.Context, rt *model.Report) (err error)

Report .

func (*Dao) Resource

func (d *Dao) Resource(c context.Context, rid int64) (res *model.Resource, err error)

Resource .

func (*Dao) RscAdd

func (d *Dao) RscAdd(c context.Context, opt *model.AddOption) error

RscAdd resource add

func (*Dao) RscCancel

func (d *Dao) RscCancel(c context.Context, opt *model.CancelOption) error

RscCancel resource cancel

func (*Dao) RscState

func (d *Dao) RscState(c context.Context, rid int64) (state int64, err error)

RscState resource state

func (*Dao) RscUpdate

func (d *Dao) RscUpdate(c context.Context, opt *model.UpdateOption) error

RscUpdate resource update

func (*Dao) SetTask

func (d *Dao) SetTask(c context.Context, task *model.Task) (err error)

SetTask .

func (*Dao) SetWeight

func (d *Dao) SetWeight(c context.Context, businessID, flowID int64, id, weight int64) (err error)

SetWeight set weight

func (*Dao) SetWeightDB

func (d *Dao) SetWeightDB(c context.Context, taskid, weight int64) (rows int64, err error)

SetWeightDB .

func (*Dao) TaskActiveConfigs

func (d *Dao) TaskActiveConfigs(c context.Context) (configs []*model.TaskConfig, err error)

TaskActiveConfigs list config

func (*Dao) TaskActiveConsumer

func (d *Dao) TaskActiveConsumer(c context.Context) (consumerCache map[string]map[int64]struct{}, err error)

TaskActiveConsumer list consumer

func (*Dao) TaskClear

func (d *Dao) TaskClear(c context.Context, mtime time.Time, limit int64) (rows int64, err error)

TaskClear 已完成任务最多保留3天

func (*Dao) TaskRelease

func (d *Dao) TaskRelease(c context.Context, mtime time.Time) (err error)

TaskRelease .

func (*Dao) TopWeights

func (d *Dao) TopWeights(c context.Context, businessID, flowID int64, toplen int64) (wis []*model.WeightItem, err error)

TopWeights .

func (*Dao) UpSpecial

func (d *Dao) UpSpecial(c context.Context, mid int64) (groupids []int64, err error)

UpSpecial 分组信息

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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