Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFixedTask ¶
Types ¶
type CronTime ¶
type CronTime struct {
cron.SpecSchedule
// json:"Location" 覆盖嵌套的 Location 域
LocationStr string `json:"Location"`
StartTime scheduler.UnixTimeSecond
RawString string `json:"raw"`
}
func NewCronTimeFromBytes ¶
func NewCronTimeFromSpec ¶
func NewCronTimeFromSpec(s *cron.SpecSchedule, start scheduler.UnixTimeSecond, rawString string) *CronTime
type DB ¶
type DB interface {
// ConflictErr : 当id已经存在,但是cronTime不相同时,返回ConflictErr
// InternalError : 其他因为DB等原因造成存储失败时,返回 InternalError
// DataErr : 数据解析等数据相关的错误,返回DataErr
// OK : 其余情况都应是OK,包括id存在且cronTime相同的情况也是OK
//
// opFlag: 只有首次添加id的数据时(包括Del(id)后的首次添加),才更新DB中opFlag的值
Add(id string, cronTime []byte, opFlag string) AddState
Exist(ids []string) (notExist []string)
Del(id string)
Get(id string) (cronTime []byte, opFlag string, ok bool)
Visit(startId string) (items []struct {
Id string
CronTime []byte
OpFlag string
},
nextId string)
}
Click to show internal directories.
Click to hide internal directories.