Documentation ¶
Overview ¶
Example (Cron) ¶
c := New() c.addFunc("*", func() { fmt.Println("111111") }) c.addFunc("*", func() { fmt.Println("222222") }) c.Start()
Output: 111
Example (Info) ¶
c := New() c.Info("schedule", "now", time.Now(), "entry", "1", "next", "2") c.Error(errors.New("无此权限"), "schedule", "now", time.Now(), "entry", "1", "next", "2")
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cron ¶
type Cron struct {
// contains filtered or unexported fields
}
Cron struct
type Logger ¶
type Logger interface { Info(values ...interface{}) Error(err error, value ...interface{}) }
Logger is Log interface
var DefaultLogger Logger = PrintfLogger(os.Stdout, defaultFormat)
DefaultLogger 默认Logger
func PrintfLogger ¶
func PrintfLogger(o io.Writer, f LogFormatter) Logger
type ParseOption ¶
type ParseOption int
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func NewParser ¶
func NewParser(options ParseOption) Parser
type PrintLogger ¶
type PrintLogger struct { Format LogFormatter // contains filtered or unexported fields }
PrintLogger ...
func (PrintLogger) Error ¶
func (l PrintLogger) Error(err error, values ...interface{})
func (PrintLogger) Info ¶
func (l PrintLogger) Info(values ...interface{})
type Schedule ¶
type Schedule interface { // Next returns the next activation time, later than the given time. // Next is invoked initially, and then each time the job is run. Next(time.Time) time.Time }
Schedule describes a job's duty cycle.
type ScheduleParser ¶
ScheduleParser is Schedule Parser interface
type SpecSchedule ¶
type SpecSchedule struct { }
Click to show internal directories.
Click to hide internal directories.