Documentation ¶
Index ¶
- Variables
- func AddJob(job Job) (jobID int, err error)
- func HandlerFilter(job Job) func(ctx gcore.Ctx) error
- func HandlerFunc() http.HandlerFunc
- func NewLogger() *logger
- func RemoveJob(jobID int) (err error)
- func SetHandlerFilter(handlerFilter func(ctx gcore.Ctx) error)
- func TriggerJob(jobID int)
- type CrontabManager
- func (s *CrontabManager) AddJob(job Job) (jobID int, err error)
- func (s *CrontabManager) ExistsJob(jobID int) bool
- func (s *CrontabManager) GetJob(jobID int) (jobItem *JobItem)
- func (s *CrontabManager) HandlerFilter() func(ctx gcore.Ctx) error
- func (s *CrontabManager) HandlerFunc() http.HandlerFunc
- func (s *CrontabManager) JobList() (jobItems []*JobItem)
- func (s *CrontabManager) RemoveJob(jobID int) (err error)
- func (s *CrontabManager) SetHandlerFilter(handlerFilter func(ctx gcore.Ctx) error)
- func (s *CrontabManager) Start() *CrontabManager
- func (s *CrontabManager) Stop() *CrontabManager
- func (s *CrontabManager) TriggerJob(jobID int) (err error)
- type Job
- type JobItem
- type MetricsRunDataItem
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultLogger = NewLogger()
)
Functions ¶
func HandlerFunc ¶
func HandlerFunc() http.HandlerFunc
func SetHandlerFilter ¶
func TriggerJob ¶
func TriggerJob(jobID int)
Types ¶
type CrontabManager ¶
type CrontabManager struct {
// contains filtered or unexported fields
}
func NewCrontabManager ¶
func NewCrontabManager() *CrontabManager
func (*CrontabManager) ExistsJob ¶
func (s *CrontabManager) ExistsJob(jobID int) bool
func (*CrontabManager) GetJob ¶
func (s *CrontabManager) GetJob(jobID int) (jobItem *JobItem)
func (*CrontabManager) HandlerFilter ¶
func (s *CrontabManager) HandlerFilter() func(ctx gcore.Ctx) error
func (*CrontabManager) HandlerFunc ¶
func (s *CrontabManager) HandlerFunc() http.HandlerFunc
func (*CrontabManager) JobList ¶
func (s *CrontabManager) JobList() (jobItems []*JobItem)
func (*CrontabManager) RemoveJob ¶
func (s *CrontabManager) RemoveJob(jobID int) (err error)
func (*CrontabManager) SetHandlerFilter ¶
func (s *CrontabManager) SetHandlerFilter(handlerFilter func(ctx gcore.Ctx) error)
func (*CrontabManager) Start ¶
func (s *CrontabManager) Start() *CrontabManager
func (*CrontabManager) Stop ¶
func (s *CrontabManager) Stop() *CrontabManager
func (*CrontabManager) TriggerJob ¶
func (s *CrontabManager) TriggerJob(jobID int) (err error)
type Job ¶
type Job struct { CronExp string Description string Executor func() Mutex bool //MaxMetricsDataLen, value 0 means 100 will be used. MaxMetricsDataLen int // contains filtered or unexported fields }
func (*Job) MetricsRunData ¶ added in v1.0.5
func (s *Job) MetricsRunData() (d []MetricsRunDataItem)
type JobItem ¶
type JobItem struct { JobID int `json:"job_id"` CronExp string `json:"cron_exp"` Description string `json:"description"` PrevAt int64 `json:"prev_at"` NextAt int64 `json:"next_at"` TriggerAt int64 `json:"trigger_at"` RunningCount int64 `json:"running_count"` Mutex bool `json:"mutex"` TriggerCount uint64 `json:"trigger_count"` RawJob *Job `json:"-"` }
Click to show internal directories.
Click to hide internal directories.