Documentation ¶
Index ¶
- func ReginSub(mission *Mission, handle func())
- func ReginWait(mission *Mission, nextAt time.Time)
- func Run()
- type ArgsGetMissionList
- type FieldsMission
- type Mission
- func (t *Mission) Do()
- func (t *Mission) Finish()
- func (t *Mission) IsStop() bool
- func (t *Mission) Pause()
- func (t *Mission) Start(nowTip string, location string, allCount int64)
- func (t *Mission) Stop()
- func (t *Mission) Update(nowTip string, location string, runCount int64)
- func (t *Mission) UpdateAddTotal(allCount int64)
- func (t *Mission) UpdateBlockTime(sec int)
- func (t *Mission) UpdateTotal(allCount int64)
- type MissionBind
- func (t *MissionBind) Finish()
- func (t *MissionBind) IsStart() bool
- func (t *MissionBind) NeedStart() bool
- func (t *MissionBind) Start()
- func (t *MissionBind) UpdateNextAt(nextAt time.Time)
- func (t *MissionBind) UpdateNextAtFutureDay(day, hour, minute, sec int)
- func (t *MissionBind) UpdateNextAtFutureHour(hour, minute, sec int)
- func (t *MissionBind) UpdateNextAtFutureMonth(month, day, hour, minute, sec int)
- func (t *MissionBind) UpdateNextAtFutureSec(sec int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArgsGetMissionList ¶
type ArgsGetMissionList struct { //分页 Pages CoreSQL2.ArgsPages `json:"pages"` //组织ID OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"` //搜索 Search string `json:"search" check:"search" empty:"true"` }
ArgsGetMissionList 获取服务列表参数
type FieldsMission ¶
type FieldsMission struct { //ID ID int64 `db:"id" json:"id"` //更新时间 UpdateAt time.Time `db:"update_at" json:"updateAt"` //组织ID // 如果为0则为系统服务 OrgID int64 `db:"org_id" json:"orgID"` //任务名称 Name string `db:"name" json:"name"` //标识码 Mark string `db:"mark" json:"mark"` //开始时间 StartAt time.Time `db:"start_at" json:"startAt"` //当前执行提示 NowTip string `db:"now_tip" json:"nowTip"` //停止时间 StopAt time.Time `db:"stop_at" json:"stopAt"` //暂停时间 PauseAt time.Time `db:"pause_at" json:"pauseAt"` //暂停位置 Location string `db:"location" json:"location"` //总数量 AllCount int64 `db:"all_count" json:"allCount"` //已经执行数量 RunCount int64 `db:"run_count" json:"runCount"` //总消耗时间秒 RunAllSec int64 `db:"run_all_sec" json:"runAllSec"` //计划执行时间 NextTime string `db:"next_time" json:"nextTime"` }
FieldsMission 任务记录
func GetMissionByMark ¶
func GetMissionByMark(orgID int64, mark string) (data FieldsMission)
GetMissionByMark 获取指定服务
func GetMissionList ¶
func GetMissionList(args *ArgsGetMissionList) (dataList []FieldsMission, dataCount int64, err error)
GetMissionList 获取服务列表
type Mission ¶
type Mission struct { //组织ID // 如果为0则为系统服务 OrgID int64 `db:"org_id" json:"orgID"` //任务名称 Name string `db:"name" json:"name"` //标识码 Mark string `db:"mark" json:"mark"` //计划执行时间 NextTime string `db:"next_time" json:"nextTime"` //挂靠模式,本模块主动触发形式 Bind MissionBind // contains filtered or unexported fields }
Mission 初始化方法
func (*Mission) UpdateAddTotal ¶
UpdateAddTotal 更新总量情况
type MissionBind ¶
type MissionBind struct { //触发消息地址 NatsMsg string // contains filtered or unexported fields }
func (*MissionBind) Finish ¶
func (t *MissionBind) Finish()
func (*MissionBind) UpdateNextAt ¶
func (t *MissionBind) UpdateNextAt(nextAt time.Time)
UpdateNextAt 更新下一次执行时间
func (*MissionBind) UpdateNextAtFutureDay ¶
func (t *MissionBind) UpdateNextAtFutureDay(day, hour, minute, sec int)
UpdateNextAtFutureDay 更新下一次执行时间到未来某一天
func (*MissionBind) UpdateNextAtFutureHour ¶
func (t *MissionBind) UpdateNextAtFutureHour(hour, minute, sec int)
UpdateNextAtFutureHour 更新下一次执行时间到明天指定时间
func (*MissionBind) UpdateNextAtFutureMonth ¶
func (t *MissionBind) UpdateNextAtFutureMonth(month, day, hour, minute, sec int)
UpdateNextAtFutureMonth 更新下一次执行时间到未来某月
func (*MissionBind) UpdateNextAtFutureSec ¶
func (t *MissionBind) UpdateNextAtFutureSec(sec int)
UpdateNextAtFutureSec 更新下一次执行时间未来几秒
Click to show internal directories.
Click to hide internal directories.