Documentation ¶
Index ¶
- Constants
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Debugln(v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Errorln(v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Index(n int, jiffies uint64) uint64
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Logger(filename string, level string) *os.File
- func Warning(v ...interface{})
- func Warningf(format string, v ...interface{})
- func Warningln(v ...interface{})
- type Task
- type TimeWheel
Constants ¶
View Source
const ( TVNBITS uint = 6 TVRBITS uint = 8 TVNSIZE = 1 << 6 TVRSIZE = 1 << 8 TVNMASK = TVNSIZE - 1 TVRMASK = TVRSIZE - 1 MAXTVAL = 1<<32 - 1 )
View Source
const ( //FatalLevel fatalerror FatalLevel = 0 //ErrorLevel error happen ErrorLevel = 1 //WarnLevel just warn something wrong WarnLevel = 2 //InfoLevel info what happen InfoLevel = 3 //DebugLevel for debug DebugLevel = 4 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Task ¶
type Task struct { JobID string Expires uint64 //time left to run Deleted bool Handle func(interface{}) //user's func to run Data interface{} //user's data for Handle to use NeedCycle bool //if needcycle if will check runweekdays RunWeekdays [7]bool //which day need to run RunTime string //save the first time to run AddDay string }
Task save job to run user's Handle
type TimeWheel ¶
type TimeWheel struct { Interval uint64 // contains filtered or unexported fields }
TimeWheel make 5 floors to save
func InitTimeWheel ¶
InitTimeWheel init and set interval
Click to show internal directories.
Click to hide internal directories.