Documentation ¶
Index ¶
- type Dao
- func (d *Dao) AddArchiveOper(c context.Context, aid int64, attribute int32, typeid int16, state int, ...) (id int64, err error)
- func (d *Dao) AddDispatch(c context.Context, t *task.Task) (lastID int64, err error)
- func (d *Dao) AddRecheckAids(c context.Context, tp int, aids []int64, ignRechecked bool) (err error)
- func (d *Dao) AddTaskHis(c context.Context, pool int8, action int8, taskID int64, cid int64, uid int64, ...) (rows int64, err error)
- func (d *Dao) AddTaskTook(c context.Context, took *archive.TaskTook) (lastID int64, err error)
- func (d *Dao) AddTrack(c context.Context, aid int64, state int, round int8, attr int32, remark string, ...) (rows int64, err error)
- func (d *Dao) AddVideoTrack(c context.Context, aid int64, filename string, status int16, xcodeState int8, ...) (rows int64, err error)
- func (d *Dao) Addit(c context.Context, aid int64) (addit *archive.Addit, err error)
- func (d *Dao) Addits(c context.Context, aids []int64) (addits map[int64]*archive.Addit, err error)
- func (d *Dao) ArchiveByAid(c context.Context, aid int64) (arc *archive.Archive, err error)
- func (d *Dao) ArchiveNote(c context.Context, aid int64) (note string, err error)
- func (d *Dao) AssignConfigs(c context.Context) (tasks map[int64]*tmod.AssignConfig, err error)
- func (d *Dao) AuditTypesConf(c context.Context) (atps map[int16]struct{}, err error)
- func (d *Dao) BeginTran(c context.Context) (tx *sql.Tx, err error)
- func (d *Dao) Close()
- func (d *Dao) ConsumerOnline(c context.Context, uids string) (ids []int64, err error)
- func (d *Dao) DelAssignConfs(c context.Context, ids []int64) (rows int64, err error)
- func (d *Dao) DelDispatch(c context.Context, aid, cid int64) (rows int64, err error)
- func (d *Dao) DelDispatchByAid(c context.Context, aid int64) (rows int64, err error)
- func (d *Dao) DelTaskBefore(c context.Context, before time.Time, limit int64) (rows int64, err error)
- func (d *Dao) DelTaskDoneBefore(c context.Context, before time.Time, limit int64) (rows int64, err error)
- func (d *Dao) DelTaskExtend(c context.Context, before time.Time, limit int64) (rows int64, err error)
- func (d *Dao) DelTaskHistoryDone(c context.Context, before time.Time, limit int64) (rows int64, err error)
- func (d *Dao) DelWeightConfs(c context.Context, ids []int64) (rows int64, err error)
- func (d *Dao) Delay(c context.Context, aid int64) (delay *archive.Delay, err error)
- func (d *Dao) DispatchState(c context.Context, aid, cid int64) (id int64, state int8, err error)
- func (d *Dao) ExcitationArchivesByTime(c context.Context, mid int64, bt, et time.Time) (archives []*archive.Archive, err error)
- func (d *Dao) FlowUnique(c context.Context, oid, groupID int64, pool int8) (f *archive.FlowData, err error)
- func (d *Dao) GetTaskWeight(c context.Context, lastid int64) (mcases map[int64]*task.WeightParams, err error)
- func (d *Dao) HasFlowGroup(c context.Context, pool int, gid, oid int64) (has bool, err error)
- func (d *Dao) InDispatchExtend(c context.Context, taskid int64, desc string) (lastid int64, err error)
- func (d *Dao) LastArcOper(c context.Context, aid int64) (re *archive.Oper, err error)
- func (d *Dao) LastRoundOper(c context.Context, aid int64, round int8) (oper *archive.Oper, err error)
- func (d *Dao) LastVideoOper(c context.Context, vid int64) (oper *archive.VideoOper, err error)
- func (d *Dao) LastVideoOperUID(c context.Context, vid int64) (uid int64, err error)
- func (d *Dao) NewVideo(c context.Context, filename string) (v *archive.Video, err error)
- func (d *Dao) NextRoundOper(c context.Context, id int64, aid int64, round int8) (oper *archive.Oper, err error)
- func (d *Dao) Ping(c context.Context) (err error)
- func (d *Dao) RecheckByAid(c context.Context, tp int, aid int64) (recheck *archive.Recheck, err error)
- func (d *Dao) ReportAdd(c context.Context, typeid int8, content string, ctime, mtime time.Time) (lastID int64, err error)
- func (d *Dao) ReportLast(c context.Context, typeid int8) (report *archive.Report, err error)
- func (d *Dao) Reports(c context.Context, typeid int8, stime, etime time.Time) (reports []*archive.Report, err error)
- func (d *Dao) SetUpSpecial(c context.Context, taskid int64, special int8) (rows int64, err error)
- func (d *Dao) TaskByMtime(c context.Context, stime time.Time) (tasks []*archive.Task, err error)
- func (d *Dao) TaskByUntreated(c context.Context) (tasks []*archive.Task, err error)
- func (d *Dao) TaskDoneByMtime(c context.Context, stime time.Time) (tasks []*archive.Task, err error)
- func (d *Dao) TaskIDforWeight(c context.Context, lastid int64) (ids []int64, last int64, err error)
- func (d *Dao) TaskTookByHalfHour(c context.Context) (took *archive.TaskTook, err error)
- func (d *Dao) TaskTooks(c context.Context, stime time.Time) (tooks []*archive.TaskTook, err error)
- func (d *Dao) TaskTooksByHalfHour(c context.Context, stime time.Time, etime time.Time) (tooks []*archive.TaskTook, err error)
- func (d *Dao) TxAddDispatchDone(c context.Context, tx *sql.Tx, startTime, endTime time.Time) (rows int64, err error)
- func (d *Dao) TxAddFlow(tx *sql.Tx, pool int8, oid, uid, groupID int64, remark string) (id int64, err error)
- func (d *Dao) TxAddFlowLog(tx *sql.Tx, pool, action int8, oid, uid, groupID int64, remark string) (id int64, err error)
- func (d *Dao) TxAddRecheckAID(tx *sql.Tx, tp int, aid int64) (id int64, err error)
- func (d *Dao) TxDelDispatchByTime(c context.Context, tx *sql.Tx, startTime, endTime time.Time) (rows int64, err error)
- func (d *Dao) TxDelTaskOper(tx *sql.Tx, t time.Time, limit int64) (rows int64, err error)
- func (d *Dao) TxMoveTaskOperDone(tx *sql.Tx, t time.Time, limit int64) (rows int64, err error)
- func (d *Dao) TxUpFlowState(tx *sql.Tx, id int64, state int8) (rows int64, err error)
- func (d *Dao) TxUpRecheckState(tx *sql.Tx, tp int, aid int64, state int8) (row int64, err error)
- func (d *Dao) TypeMapping(c context.Context) (rmap map[int16]*archive.Type, err error)
- func (d *Dao) UpTag(c context.Context, aid int64, tags string) (rows int64, err error)
- func (d *Dao) UpTaskWeight(c context.Context, taskid int64, weight int64) (rows int64, err error)
- func (d *Dao) UpdateMidRecheckState(c context.Context, tp int, mid int64, state int8) (err error)
- func (d *Dao) UpdateRecheckState(c context.Context, tp int, aid int64, state int8) (err error)
- func (d *Dao) UpdatedFilenames(c context.Context, stime, etime time.Time) (fns []string, err error)
- func (d *Dao) VideoAuditNote(c context.Context, vid int64) (note string, err error)
- func (d *Dao) Videos2(c context.Context, aid int64) (vs []*archive.Video, err error)
- func (d *Dao) WeightConf(c context.Context) (items []*tmod.ConfigItem, err error)
- func (d *Dao) WeightValueConf(c context.Context) (wvconf *task.WeightValueConf, err error)
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 is redis dao.
func (*Dao) AddArchiveOper ¶
func (d *Dao) AddArchiveOper(c context.Context, aid int64, attribute int32, typeid int16, state int, round int8, lastID int64, content, remark string) (id int64, err error)
AddArchiveOper add archive operate log
func (*Dao) AddDispatch ¶
AddDispatch add task dispatch
func (*Dao) AddRecheckAids ¶
func (d *Dao) AddRecheckAids(c context.Context, tp int, aids []int64, ignRechecked bool) (err error)
AddRecheckAids add recheck aids
func (*Dao) AddTaskHis ¶
func (d *Dao) AddTaskHis(c context.Context, pool int8, action int8, taskID int64, cid int64, uid int64, result int16, reason string) (rows int64, err error)
AddTaskHis add task oper history
func (*Dao) AddTaskTook ¶
AddTaskTook add TaskTook
func (*Dao) AddTrack ¶
func (d *Dao) AddTrack(c context.Context, aid int64, state int, round int8, attr int32, remark string, ctime, mtime string) (rows int64, err error)
AddTrack insert archive track history
func (*Dao) AddVideoTrack ¶
func (d *Dao) AddVideoTrack(c context.Context, aid int64, filename string, status int16, xcodeState int8, remark string, ctime, mtime string) (rows int64, err error)
AddVideoTrack insert video track history
func (*Dao) ArchiveByAid ¶
ArchiveByAid get archive by aid
func (*Dao) ArchiveNote ¶
ArchiveNote 稿件审核的备注字段,可能为NIL
func (*Dao) AssignConfigs ¶
AssignConfigs take config
func (*Dao) AuditTypesConf ¶
AuditTypesConf get audit conf
func (*Dao) ConsumerOnline ¶
ConsumerOnline get online task_consumer
func (*Dao) DelAssignConfs ¶
DelAssignConfs 删除指派配置
func (*Dao) DelDispatch ¶
DelDispatch del dispatch.
func (*Dao) DelDispatchByAid ¶
DelDispatchByAid del dispatch by aid.
func (*Dao) DelTaskBefore ¶
func (d *Dao) DelTaskBefore(c context.Context, before time.Time, limit int64) (rows int64, err error)
DelTaskBefore del task_dispatch
func (*Dao) DelTaskDoneBefore ¶
func (d *Dao) DelTaskDoneBefore(c context.Context, before time.Time, limit int64) (rows int64, err error)
DelTaskDoneBefore del task_dispatch_done
func (*Dao) DelTaskExtend ¶
func (d *Dao) DelTaskExtend(c context.Context, before time.Time, limit int64) (rows int64, err error)
DelTaskExtend del task_dispatch_extend
func (*Dao) DelTaskHistoryDone ¶
func (d *Dao) DelTaskHistoryDone(c context.Context, before time.Time, limit int64) (rows int64, err error)
DelTaskHistoryDone del oper done
func (*Dao) DelWeightConfs ¶
DelWeightConfs 删除权重配置
func (*Dao) DispatchState ¶
DispatchState get dipatch state.
func (*Dao) ExcitationArchivesByTime ¶
func (d *Dao) ExcitationArchivesByTime(c context.Context, mid int64, bt, et time.Time) (archives []*archive.Archive, err error)
ExcitationArchivesByTime 获取Up主过审的自制稿件
func (*Dao) FlowUnique ¶
func (d *Dao) FlowUnique(c context.Context, oid, groupID int64, pool int8) (f *archive.FlowData, err error)
FlowUnique 获取命中 指定流量套餐的记录 return *archive.FlowData/nil, error/nil
func (*Dao) GetTaskWeight ¶
func (d *Dao) GetTaskWeight(c context.Context, lastid int64) (mcases map[int64]*task.WeightParams, err error)
GetTaskWeight 从数据库读取权重配置
func (*Dao) HasFlowGroup ¶
HasFlowGroup check if has flow group record
func (*Dao) InDispatchExtend ¶
func (d *Dao) InDispatchExtend(c context.Context, taskid int64, desc string) (lastid int64, err error)
InDispatchExtend 扩展表,记录权重配置信息
func (*Dao) LastArcOper ¶
LastArcOper get a archive last history.
func (*Dao) LastRoundOper ¶
func (d *Dao) LastRoundOper(c context.Context, aid int64, round int8) (oper *archive.Oper, err error)
LastRoundOper get last archive round record.
func (*Dao) LastVideoOper ¶
LastVideoOper get the last manual-operate record by vid
func (*Dao) LastVideoOperUID ¶
LastVideoOperUID get the last manual-operate operator id by vid
func (*Dao) NextRoundOper ¶
func (d *Dao) NextRoundOper(c context.Context, id int64, aid int64, round int8) (oper *archive.Oper, err error)
NextRoundOper get next archive round record.
func (*Dao) RecheckByAid ¶
func (d *Dao) RecheckByAid(c context.Context, tp int, aid int64) (recheck *archive.Recheck, err error)
RecheckByAid find archive recheck
func (*Dao) ReportAdd ¶
func (d *Dao) ReportAdd(c context.Context, typeid int8, content string, ctime, mtime time.Time) (lastID int64, err error)
ReportAdd report add of typeid
func (*Dao) ReportLast ¶
ReportLast get last inserted report
func (*Dao) Reports ¶
func (d *Dao) Reports(c context.Context, typeid int8, stime, etime time.Time) (reports []*archive.Report, err error)
Reports report get of typeid
func (*Dao) SetUpSpecial ¶
SetUpSpecial 更新单条权重
func (*Dao) TaskByMtime ¶
TaskByMtime gets to took the task by mtime
func (*Dao) TaskByUntreated ¶
TaskByUntreated gets to took the task by untreated
func (*Dao) TaskDoneByMtime ¶
func (d *Dao) TaskDoneByMtime(c context.Context, stime time.Time) (tasks []*archive.Task, err error)
TaskDoneByMtime gets to took the task done by mtime
func (*Dao) TaskIDforWeight ¶
TaskIDforWeight 获取需要更新权重的任务id(用于给redis批量读取)
func (*Dao) TaskTookByHalfHour ¶
TaskTookByHalfHour get TaskTook by half hour
func (*Dao) TaskTooksByHalfHour ¶
func (d *Dao) TaskTooksByHalfHour(c context.Context, stime time.Time, etime time.Time) (tooks []*archive.TaskTook, err error)
TaskTooksByHalfHour get TaskTooks by half hour
func (*Dao) TxAddDispatchDone ¶
func (d *Dao) TxAddDispatchDone(c context.Context, tx *sql.Tx, startTime, endTime time.Time) (rows int64, err error)
TxAddDispatchDone add task dispatch done
func (*Dao) TxAddFlow ¶
func (d *Dao) TxAddFlow(tx *sql.Tx, pool int8, oid, uid, groupID int64, remark string) (id int64, err error)
TxAddFlow tx add flow_design.
func (*Dao) TxAddFlowLog ¶
func (d *Dao) TxAddFlowLog(tx *sql.Tx, pool, action int8, oid, uid, groupID int64, remark string) (id int64, err error)
TxAddFlowLog tx add flow_design log.
func (*Dao) TxAddRecheckAID ¶
TxAddRecheckAID add recheck aid to db
func (*Dao) TxDelDispatchByTime ¶
func (d *Dao) TxDelDispatchByTime(c context.Context, tx *sql.Tx, startTime, endTime time.Time) (rows int64, err error)
TxDelDispatchByTime del dispatch by time segment
func (*Dao) TxDelTaskOper ¶
TxDelTaskOper delete from task_oper_history before t.
func (*Dao) TxMoveTaskOperDone ¶
TxMoveTaskOperDone select into from task_oper_history to task_oper_history_done before t.
func (*Dao) TxUpFlowState ¶
TxUpFlowState 更新pool!=1的流量套餐资源的状态 return int64, error/nil
func (*Dao) TxUpRecheckState ¶
TxUpRecheckState update recheck state
func (*Dao) TypeMapping ¶
TypeMapping is second types opposite first types.
func (*Dao) UpTaskWeight ¶
UpTaskWeight 更新单条权重
func (*Dao) UpdateMidRecheckState ¶
UpdateMidRecheckState 设置某个UP主的未回查稿件回查状态
func (*Dao) UpdateRecheckState ¶
UpdateRecheckState update recheck state
func (*Dao) UpdatedFilenames ¶
UpdatedFilenames Get updated video's filename between stime and etime.
func (*Dao) VideoAuditNote ¶
VideoAuditNote get note by vid
func (*Dao) WeightConf ¶
WeightConf 所有有效的配置(用于检测是否和以及有的配置冲突)
func (*Dao) WeightValueConf ¶
WeightValueConf 权重数值配置