Documentation
¶
Index ¶
- func InitManagement()
- type Item
- type Management
- func (m *Management) Add(item *Item)
- func (m *Management) AddTask(second string, minute string, hour string, dayOfMonth string, month string, ...)
- func (m *Management) AddTaskString(taskStr string, exec func(item *Item) bool, callback func(item *Item), ...)
- func (m *Management) ClearTask()
- func (m *Management) RemoveForeach(f func(*Item) bool)
- func (m *Management) RemoveTask(item *Item)
- func (m *Management) Start()
- func (m *Management) Status() string
- func (m *Management) Stop()
- type Rule
- type TimeType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Item ¶
type Item struct { RuleList []*Rule //规则列表 ExecFunc func(item *Item) bool //任务执行方法 CallbackFunc func(item *Item) //任务回调方法 LastExecDate time.Time //最后执行任务的时间 Args []interface{} //任务数据 Lock sync.RWMutex }
Item 任务项
type Management ¶
type Management struct {
// contains filtered or unexported fields
}
Management 任务管理
var ManagementService *Management
全局类
func (*Management) AddTask ¶
func (m *Management) AddTask( second string, minute string, hour string, dayOfMonth string, month string, dayOfWeek string, exec func(item *Item) bool, callback func(item *Item), args ...interface{})
AddTask 使用选项添加一个任务项
func (*Management) AddTaskString ¶
func (m *Management) AddTaskString(taskStr string, exec func(item *Item) bool, callback func(item *Item), args ...interface{})
AddTaskString 使用选项字符串添加一个任务项
func (*Management) RemoveForeach ¶
func (m *Management) RemoveForeach(f func(*Item) bool)
RemoveForeach foreach 回调方法删除一个任务
func (*Management) Status ¶
func (m *Management) Status() string
func (*Management) Stop ¶
func (m *Management) Stop()
Click to show internal directories.
Click to hide internal directories.