Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package
v4.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package postgres stores scheduler run records in Postgres.

Use it with the stable scheduler package when applications need durable run history, restart suppression, and operational visibility backed by a Postgres database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunsRepo

type RunsRepo struct {
	Pool contracts.DatabasePool
}

RunsRepo stores scheduler job executions.

func NewRunsRepo

func NewRunsRepo(pool contracts.DatabasePool) *RunsRepo

NewRunsRepo creates a runs repository backed by Postgres.

func (*RunsRepo) LastFinished

func (r *RunsRepo) LastFinished(ctx context.Context, jobName string) (time.Time, bool, error)

LastFinished returns the most recent finished timestamp for a job.

func (*RunsRepo) Record

func (r *RunsRepo) Record(ctx context.Context, jobName string, startedAt, finishedAt time.Time, success bool, errMsg string) error

Record stores a completed job run.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL