Documentation
¶
Overview ¶
Package rivertype stores some of the lowest level River primitives so they can be shared amongst a number of packages including the top-level river package, database drivers, and internal utilities.
Index ¶
- Constants
- Variables
- func JobCancel(err error) error
- type AttemptError
- type DurablePeriodicJob
- type Hook
- type HookInsertBegin
- type HookPeriodicJobsStart
- type HookPeriodicJobsStartParams
- type HookWorkBegin
- type HookWorkEnd
- type JobArgs
- type JobCancelError
- type JobInsertMiddleware
- type JobInsertParams
- type JobInsertResult
- type JobRow
- type JobSnoozeError
- type JobState
- type Middleware
- type PeriodicJobHandle
- type Queue
- type TimeGenerator
- type UnknownJobKindError
- type WorkerMetadata
- type WorkerMiddleware
Constants ¶
const MetadataKeyOutput = "output"
MetadataKeyOutput is the metadata key used to store recorded job output.
Variables ¶
var ErrJobCancelledRemotely = JobCancel(errors.New("job cancelled remotely"))
var ErrJobRunning = errors.New("running jobs cannot be deleted")
ErrJobRunning is returned when a job is attempted to be deleted while it's running.
var ErrNotFound = errors.New("not found")
ErrNotFound is returned when a query by ID does not match any existing rows. For example, attempting to cancel a job that doesn't exist will return this error.
Functions ¶
func JobCancel ¶ added in v0.18.0
JobCancel wraps err and can be returned from a Worker's Work method to cancel the job at the end of execution. Regardless of whether or not the job has any remaining attempts, this will ensure the job does not execute again.
This function primarily exists for cross module compatibility. Users should use river.JobCancel instead.
Types ¶
type AttemptError ¶
type AttemptError struct {
// At is the time at which the error occurred.
At time.Time `json:"at"`
// Attempt is the attempt number on which the error occurred (maps to
// Attempt on a job row).
Attempt int `json:"attempt"`
// Error contains the stringified error of an error returned from a job or a
// panic value in case of a panic.
Error string `json:"error"`
// Trace contains a stack trace from a job that panicked. The trace is
// produced by invoking `debug.Trace()`.
//
// In the case of a non-panic or an error produced as a stuck job was
// rescued, this value will be an empty string.
Trace string `json:"trace"`
}
AttemptError is an error from a single job attempt that failed due to an error or a panic.
type DurablePeriodicJob ¶ added in v0.29.0
type DurablePeriodicJob struct {
//