Documentation ¶
Index ¶
- Variables
- func AddJob(spec string, job *Job) bool
- func AddSYSJob(name string, fn RunnerGetter, example string, description string)
- func Close()
- func CmdParams(command string) []string
- func GetEntries(size int) []*cron.Entry
- func GetEntryById(id uint) *cron.Entry
- func HistoryJobsRunning() bool
- func InitJobs(ctx context.Context) error
- func Initial(sizes ...int)
- func InitialMailTpl()
- func MailTpl() *template.Template
- func MainCron(mustStart bool) *cron.Cron
- func NewCmdRec(max uint64) *cmdRec
- func Parse(spec string) error
- func RemoveJob(id uint)
- func Running() bool
- func SendMail(toEmail string, toUsername string, title string, content []byte, ...) error
- func SendMailWithID(id uint64, toEmail string, toUsername string, title string, content []byte, ...) error
- type EmailConfig
- type Job
- type Jobx
- type Runner
- type RunnerGetter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PoolSize = 50 //连接池容量 DefaultSMTPConfig = &mail.SMTPConfig{} //STMP配置 DefaultEmailConfig = &EmailConfig{} )
View Source
var ( SYSJobs = map[string]Jobx{} ErrFailure = errors.New(`Error`) //NotRecordPrefixFlag 不记录日志的前缀标识 NotRecordPrefixFlag = `--/ignore/--` )
View Source
var (
ErrIncorrectRecipient = errors.New(`The recipient's email address is incorrect`)
)
Functions ¶
func GetEntries ¶
func GetEntryById ¶
func HistoryJobsRunning ¶
func HistoryJobsRunning() bool
func InitialMailTpl ¶
func InitialMailTpl()
Types ¶
type EmailConfig ¶
type Job ¶
type Job struct { Concurrent bool // 同一个任务是否允许并行执行 // contains filtered or unexported fields }
func NewCommandJob ¶
type Jobx ¶
type Jobx struct { Example string //">funcName:param" Description string RunnerGetter RunnerGetter }
type RunnerGetter ¶
Click to show internal directories.
Click to hide internal directories.