rivertype

package module
v0.34.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2026 License: MPL-2.0 Imports: 5 Imported by: 65

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

View Source
const MetadataKeyOutput = "output"

MetadataKeyOutput is the metadata key used to store recorded job output.

Variables

View Source
var ErrJobCancelledRemotely = JobCancel(errors.New("job cancelled remotely"))
View Source
var ErrJobRunning = errors.New("running jobs cannot be deleted")

ErrJobRunning is returned when a job is attempted to be deleted while it's running.

View Source
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

func JobCancel(err error) error

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 {
	//