Documentation
¶
Index ¶
- Variables
- type JobClaim
- type LogLine
- type Repository
- func (r *Repository) Cancel(ctx context.Context, id pgtype.UUID, version int32) (db.Job, error)
- func (r *Repository) ClaimForExecution(ctx context.Context, id pgtype.UUID, workerID string, ...) (db.ClaimJobForExecutionRow, error)
- func (r *Repository) CompleteAttempt(ctx context.Context, attemptID pgtype.UUID, outcome db.AttemptOutcome, ...) (bool, error)
- func (r *Repository) CompleteJob(ctx context.Context, id pgtype.UUID, version int32, ...) (bool, error)
- func (r *Repository) Create(ctx context.Context, arg db.CreateJobParams) (job db.Job, created bool, err error)
- func (r *Repository) Delete(ctx context.Context, id pgtype.UUID) error
- func (r *Repository) FinalizeExpiredJobs(ctx context.Context) ([]pgtype.UUID, error)
- func (r *Repository) GetAttempt(ctx context.Context, attemptID, jobID pgtype.UUID) (db.JobAttempt, error)
- func (r *Repository) GetByID(ctx context.Context, id pgtype.UUID) (db.Job, error)
- func (r *Repository) GetJobAttemptLogs(ctx context.Context, attemptID pgtype.UUID, fromTS, toTS pgtype.Timestamptz, ...) ([]db.GetAttemptLogsRow, error)
- func (r *Repository) GetJobsReadyToRun(ctx context.Context, maxFetchPerQueue int, agingRate float64) ([]db.GetDueJobsRow, error)
- func (r *Repository) InsertJobLogs(ctx context.Context, lines []LogLine) (int64, error)
- func (r *Repository) List(ctx context.Context, arg db.ListJobsParams) ([]db.Job, error)
- func (r *Repository) ListAttempts(ctx context.Context, jobID pgtype.UUID, limit, offset int32) ([]db.JobAttempt, error)
- func (r *Repository) MarksJobAsQueued(ctx context.Context, ids []pgtype.UUID, claimDeadline pgtype.Interval) ([]pgtype.UUID, error)
- func (r *Repository) Pause(ctx context.Context, id pgtype.UUID, version int32) (db.Job, error)
- func (r *Repository) ReclaimStale(ctx context.Context, maxDeliveryCount int32) ([]db.Job, error)
- func (r *Repository) RecordExecutionFailure(ctx context.Context, id pgtype.UUID, version int32, ...) (bool, error)
- func (r *Repository) RefreshHeartbeats(ctx context.Context, claims []JobClaim, staleDelta pgtype.Interval) ([]pgtype.UUID, error)
- func (r *Repository) Rerun(ctx context.Context, id pgtype.UUID, version int32) (db.Job, error)
- func (r *Repository) Reschedule(ctx context.Context, arg db.RescheduleJobParams) (db.Job, error)
- func (r *Repository) Resume(ctx context.Context, id pgtype.UUID, version int32) (db.Job, error)
- func (r *Repository) SupersedeOpenAttempts(ctx context.Context, jobIDs []pgtype.UUID) error
- func (r *Repository) UpdateLostJob(ctx context.Context, result string) ([]pgtype.UUID, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("job not found") ErrConflict = errors.New("job was modified or is not in a valid state for this transition") )
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func New ¶
func New(q db.Querier) *Repository
func (*Repository) ClaimForExecution ¶
func (*Repository) CompleteAttempt ¶
func (*Repository) CompleteJob ¶
func (r *Repository) CompleteJob(ctx context.Context, id pgtype.UUID, version int32, nextRunAt pgtype.Timestamptz) (bool, error)
func (*Repository) Create ¶
func (r *Repository) Create(ctx context.Context, arg db.CreateJobParams) (job db.Job, created bool, err error)
func (*Repository) FinalizeExpiredJobs ¶
func (*Repository) GetAttempt ¶
func (r *Repository) GetAttempt(ctx context.Context, attemptID, jobID pgtype.UUID) (db.JobAttempt, error)
func (*Repository) GetJobAttemptLogs ¶
func (r *Repository) GetJobAttemptLogs(ctx context.Context, attemptID pgtype.UUID, fromTS, toTS pgtype.Timestamptz, afterSeq, limit int32) ([]db.GetAttemptLogsRow, error)
func (*Repository) GetJobsReadyToRun ¶
func (r *Repository) GetJobsReadyToRun(ctx context.Context, maxFetchPerQueue int, agingRate float64) ([]db.GetDueJobsRow, error)
func (*Repository) InsertJobLogs ¶
func (*Repository) List ¶
func (r *Repository) List(ctx context.Context, arg db.ListJobsParams) ([]db.Job, error)
func (*Repository) ListAttempts ¶
func (r *Repository) ListAttempts(ctx context.Context, jobID pgtype.UUID, limit, offset int32) ([]db.JobAttempt, error)
func (*Repository) MarksJobAsQueued ¶
func (*Repository) ReclaimStale ¶
func (*Repository) RecordExecutionFailure ¶
func (r *Repository) RecordExecutionFailure(ctx context.Context, id pgtype.UUID, version int32, nextCheckAt pgtype.Timestamptz) (bool, error)
func (*Repository) RefreshHeartbeats ¶
func (*Repository) Reschedule ¶
func (r *Repository) Reschedule(ctx context.Context, arg db.RescheduleJobParams) (db.Job, error)
func (*Repository) SupersedeOpenAttempts ¶
func (*Repository) UpdateLostJob ¶
Click to show internal directories.
Click to hide internal directories.