Documentation
¶
Index ¶
- type Engine
- func (e *Engine) AddJob(job *Job) error
- func (e *Engine) EnableJob(id string, enabled bool)
- func (e *Engine) ListJobs() []*Job
- func (e *Engine) MarshalJSON() ([]byte, error)
- func (e *Engine) RemoveJob(id string)
- func (e *Engine) Start()
- func (e *Engine) Status() map[string]interface{}
- func (e *Engine) Stop()
- type Job
- type JobHandler
- type RunRecord
- type RunStatus
- type Schedule
- type ScheduleKind
- type SessionTarget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewEngine ¶
func NewEngine(handler JobHandler, maxConcurrent int) *Engine
func (*Engine) MarshalJSON ¶
type Job ¶
type Job struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled"`
Schedule Schedule `json:"schedule"`
SessionTarget SessionTarget `json:"session_target"`
Payload string `json:"payload"`
DeleteAfterRun bool `json:"delete_after_run,omitempty"`
ConsecutiveErrors int `json:"consecutive_errors"`
LastRunAt *time.Time `json:"last_run_at,omitempty"`
LastStatus RunStatus `json:"last_status,omitempty"`
NextRunAt *time.Time `json:"next_run_at,omitempty"`
MaxRetries int `json:"max_retries"`
CreatedAt time.Time `json:"created_at"`
}
type JobHandler ¶
type Schedule ¶
type Schedule struct {
Kind ScheduleKind `json:"kind"`
At *time.Time `json:"at,omitempty"`
Every time.Duration `json:"every,omitempty"`
}
type ScheduleKind ¶
type ScheduleKind string
const ( ScheduleAt ScheduleKind = "at" ScheduleEvery ScheduleKind = "every" )
type SessionTarget ¶
type SessionTarget string
const ( SessionMain SessionTarget = "main" SessionIsolated SessionTarget = "isolated" )
Click to show internal directories.
Click to hide internal directories.