Documentation ¶
Index ¶
- Variables
- func AddJob(spec string, job *Job) bool
- func AddSYSJob(name string, fn RunnerGetter, example string, description string)
- func AddSender(sender func(params param.Store) error)
- func Close()
- func CmdParams(command string) []string
- func EmailSender(params param.Store) error
- 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 MainCron(mustStart bool) *cron.Cron
- func OtherSender(params param.Store) error
- func Parse(spec string) error
- func RemoveJob(id uint)
- func Running() bool
- func Send(params param.Store) (err error)
- type Job
- type Jobx
- type OutputWriter
- type Runner
- type RunnerGetter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // SYSJobs 系统Job SYSJobs = map[string]Jobx{} // ErrFailure 报错:执行失败 ErrFailure = errors.New(`Error`) // Senders 发信程序 Senders = []func(param.Store) error{} )
View Source
var ( // SendMail 发送Email // @param toEmail 收信邮箱 // @param toUsername 收信人名称 // @param title 邮件标题 // @param content 邮件内容 // @param ccList 抄送地址 SendMail = send.Mail // SendMailWithID 发送Email(带ID参数) SendMailWithID = send.MailWithID // SendMailWithNoticer 发送Email(带Noticer参数) SendMailWithNoticer = send.MailWithNoticer // SendMailWithIDAndNoticer 发送Email(带ID和Noticer参数) SendMailWithIDAndNoticer = send.MailWithIDAndNoticer NewCmdRec = writer.New )
View Source
var (
PoolSize = 50 //连接池容量
)
Functions ¶
func AddSYSJob ¶
func AddSYSJob(name string, fn RunnerGetter, example string, description string)
AddSYSJob 添加系统Job
func EmailSender ¶
func GetEntries ¶
func GetEntryById ¶
func HistoryJobsRunning ¶
func HistoryJobsRunning() bool
func OtherSender ¶
Types ¶
type Job ¶
type Job struct { Concurrent bool // 同一个任务是否允许并行执行 // contains filtered or unexported fields }
func NewCommandJob ¶
func NewJobFromTask ¶
func (*Job) LogData ¶
func (j *Job) LogData() *dbschema.NgingTaskLog
type Jobx ¶
type Jobx struct { Example string //">funcName:param" Description string RunnerGetter RunnerGetter }
type OutputWriter ¶
type OutputWriter = writer.OutputWriter
func NewOutputWriter ¶
func NewOutputWriter(sizes ...uint64) OutputWriter
type RunnerGetter ¶
Click to show internal directories.
Click to hide internal directories.