Documentation
¶
Index ¶
- Variables
- func ISOWeekday(tm time.Time) int
- func NextWithLast(tm time.Time) funcopt.O
- func NextWithTime(tm time.Time) funcopt.O
- type Expr
- func (t *Expr) Append(s string) error
- func (t *Expr) AppendExprDataset(ds Schedules)
- func (t *Expr) Dataset() Schedules
- func (t *Expr) Next(opts ...funcopt.O) (time.Time, time.Duration, error)
- func (t Expr) String() string
- func (t *Expr) Test(tm time.Time) (time.Duration, error)
- func (t *Expr) TestWithLast(tm time.Time, last time.Time) (time.Duration, error)
- type Schedule
- func (t Schedule) GetTimerange(tm, last time.Time) (time.Time, time.Duration, error)
- func (t Schedule) IsInDays(tm time.Time) bool
- func (t Schedule) IsInMonths(tm time.Time) bool
- func (t Schedule) IsInWeeks(tm time.Time) bool
- func (t Schedule) TestIsInDays(tm time.Time) error
- func (t Schedule) TestIsInMonths(tm time.Time) error
- func (t Schedule) TestIsInWeeks(tm time.Time) error
- type Schedules
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotAllowed = errors.New("not allowed") ErrExcluded = errors.New("excluded") ErrInvalid = errors.New("invalid expression") ErrImpossible = errors.New("impossible schedule") ErrDrift = errors.New("drift") ErrNextDay = errors.New("next day") SchedFmt = "%s: %s" AllMonths = []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} AllWeekdays = []int{1, 2, 3, 4, 5, 6, 7} AllDays = []day{ {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, } CalendarNames = map[string]int{ "jan": 1, "feb": 2, "mar": 3, "apr": 4, "may": 5, "jun": 6, "jul": 7, "aug": 8, "sep": 9, "oct": 10, "nov": 11, "dec": 12, "january": 1, "february": 2, "march": 3, "april": 4, "june": 6, "july": 7, "august": 8, "september": 9, "october": 10, "november": 11, "december": 12, "mon": 1, "tue": 2, "wed": 3, "thu": 4, "fri": 5, "sat": 6, "sun": 7, "monday": 1, "tuesday": 2, "wednesday": 3, "thursday": 4, "friday": 5, "saturday": 6, "sunday": 7, } )
Functions ¶
func ISOWeekday ¶
ISOWeekday is like (time.Time).Weekday, but sunday is 7 instead of 0
Types ¶
type Expr ¶
type Expr struct {
// contains filtered or unexported fields
}
func (*Expr) AppendExprDataset ¶
type Schedule ¶
type Schedule struct {
// contains filtered or unexported fields
}
Schedule is a single parsed scheduling expression
func (Schedule) GetTimerange ¶
Click to show internal directories.
Click to hide internal directories.