import "code.google.com/p/tcgl/time"
Time is a helpful package for working with times and dates.
func DayInList(time time.Time, days []int) bool
DayInList tests if the day of a time is in a given list.
func DayInRange(time time.Time, minDay, maxDay int) bool
DayInRange tests if a day of a time is in a given range.
func HourInList(time time.Time, hours []int) bool
HourInList tests if the hour of a time is in a given list.
func HourInRange(time time.Time, minHour, maxHour int) bool
HourInRange tests if a hour of a time is in a given range.
func MinuteInList(time time.Time, minutes []int) bool
MinuteInList tests if the minute of a time is in a given list.
func MinuteInRange(time time.Time, minMinute, maxMinute int) bool
MinuteInRange tests if a minute of a time is in a given range.
func MonthInList(time time.Time, months []time.Month) bool
MonthInList tests if the month of a time is in a given list.
func MonthInRange(time time.Time, minMonth, maxMonth time.Month) bool
MonthInRange tests if a month of a time is in a given range.
func SecondInList(time time.Time, seconds []int) bool
SecondInList tests if the second of a time is in a given list.
func SecondInRange(time time.Time, minSecond, maxSecond int) bool
SecondInRange tests if a second of a time is in a given range.
func WeekdayInList(time time.Time, weekdays []time.Weekday) bool
WeekdayInList tests if the weekday of a time is in a given list.
func WeekdayInRange(time time.Time, minWeekday, maxWeekday time.Weekday) bool
WeekdayInRange tests if a weekday of a time is in a given range.
func YearInList(time time.Time, years []int) bool
YearInList test if the year of a time is in a given list.
func YearInRange(time time.Time, minYear, maxYear int) bool
YearInRange tests if a year of a time is in a given range.
type CheckFunc func(time.Time) (bool, bool)
CheckFunc is the function type for checking if a job shall be performed now. It also returns if a job shall be deleted after execution.
type Crontab struct {
// contains filtered or unexported fields
}Crontab is one cron server. A system can run multiple in parallel.
func NewCrontab() *Crontab
NewCrontab creates a cron server.
func (c *Crontab) AddJob(id string, cf CheckFunc, tf TaskFunc)
AddJob adds a new job to the server.
func (c *Crontab) DeleteJob(id string)
DeleteJob removes a job from the server.
func (c *Crontab) Stop()
Stop terminates the server.
type TaskFunc func(string)
TaskFunc is the function type that will be performed if a jobs check func returns true.