Documentation
¶
Overview ¶
Package cronexpr parses cron time expressions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Expression ¶
type Expression struct {
// contains filtered or unexported fields
}
A Expression represents a specific cron time expression as defined at
func (*Expression) Next ¶
NextN returns a slice of `n` closest time instants immediately following `fromTime` which match the cron expression `expr`.
The time instants in the returned slice are in chronological ascending order. The `time.Location` of the returned time instants is the same as that of `fromTime`.
The start time The `time.Location` of the returned time instants is the same as that of `startDate`.
The end time The `time.Location` of the returned time instants is the same as that of `endDate`.
A slice with len between [0-`n`] is returned, that is, if not enough existing matching time instants exist, the number of returned entries will be less than `n`.
func (*Expression) NextN ¶
NextN returns a slice of `n` closest time instants immediately following `fromTime` which match the cron expression `expr`.
The time instants in the returned slice are in chronological ascending order. The `time.Location` of the returned time instants is the same as that of `fromTime`.
The start time The `time.Location` of the returned time instants is the same as that of `startDate`.
A slice with len between [0-`n`] is returned, that is, if not enough existing matching time instants exist, the number of returned entries will be less than `n`.
func (*Expression) Validate ¶
func (expr *Expression) Validate(curTime, startTime time.Time) (*Expression, error)
Validate 验证