Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Doer ¶
type Doer interface { Schedule() Execute() ExecutionResult OnSuccess() OnError() OnUnidentified() Log() }
type ExecutionResult ¶
type Handlers ¶
type Handlers struct { ExecuteFn func(*Job) ExecutionResult OnErrorFn func(*Job) OnSuccessFn func(*Job) }
type Job ¶
type Job struct { Id uuid.UUID `json:"id"` Name string `json:"name"` CronExp cronParser.CronExpresion `json:"-"` CronExpString string `json:"cronexp"` LastExecution time.Time `json:"lastExecution"` ShouldExecuteAt time.Time `json:"shouldExecuteAt"` LastResponseAt time.Time `json:"lastResponseAt"` LastMessage string `json:"lastMessage"` LastStatusCode int `json:"lastStatusCode"` MaxRetries int `json:"maxRetries"` Endpoint string `json:"endpoint"` HttpMethod string `json:"httpmethod"` Headers map[string]string `json:"headers"` SuccessStatuses []int `json:"successStatuses"` Succeeded string `json:"succeeded"` Status string `json:"status"` ClaimedBy string `json:"claimedBy"` CreatedAt int `json:"createdAt"` AlertStrategy string `json:"alertStrategy"` AlertMethod string `json:"alertMethod"` AlertEndpoint string `json:"alertEndpoint"` AlertPayload string `json:"alertPayload"` AlertHeaders map[string]string `json:"alertHeaders"` TLSClientCert string `json:"-"` Scheduled bool `json:"-"` AbortChannel chan struct{} `json:"-"` Doer `json:"-"` Handlers Handlers `json:"-"` }
func (*Job) AlertingInput ¶
func (j *Job) AlertingInput() models.AlertInput
func (*Job) Execute ¶
func (j *Job) Execute() ExecutionResult
func (*Job) InitExpression ¶
func (j *Job) InitExpression(parseFn cronParser.ParseFn) error
type JobExecution ¶
type JobExecution struct { Id uuid.UUID `json:"id"` JobId uuid.UUID `json:"jobId"` Name string `json:"name"` CronExpString string `json:"cronexp"` LastExecution time.Time `json:"lastExecution"` ShouldExecuteAt time.Time `json:"shouldExecuteAt"` LastResponseAt time.Time `json:"lastResponseAt"` LastMessage string `json:"lastMessage"` LastStatusCode int `json:"lastStatusCode"` Endpoint string `json:"endpoint"` HttpMethod string `json:"httpmethod"` Headers map[string]string `json:"headers"` SuccessStatuses []int `json:"successStatuses"` Succeeded string `json:"succeeded"` Status string `json:"status"` ClaimedBy string `json:"claimedBy"` CreatedAt int `json:"createdAt"` DeletedAt int `json:"deletedAt,omitempty"` }
Click to show internal directories.
Click to hide internal directories.