Documentation ¶
Index ¶
- Constants
- func NewDequeuer(db *sql.DB, dbListener *pq.Listener, cfg config.Queue) queue.Dequeuer
- func NewDequeuerWithMetrics(db *sql.DB, dbListener *pq.Listener, cfg config.Queue) queue.Dequeuer
- func NewQueuer(db *sql.DB) queue.Queuer
- func NewQueuerWithMetrics(db *sql.DB) queue.Queuer
- func NewScheduler(db *sql.DB) queue.Scheduler
- func NewSchedulerWithMetrics(db *sql.DB) queue.Scheduler
- func SetupTables(ctx context.Context, db db.SQLDB, references []ForeignReference) (err error)
- type ForeignReference
Constants ¶
View Source
const ( // TasksTable is the name of the Postgres table that is used for tasks TasksTable = "tasks" // SchedulesTable is the name of the Postgres table used for schedules SchedulesTable = "schedules" )
Variables ¶
This section is empty.
Functions ¶
func NewDequeuer ¶
NewDequeuer creates a new postgres queue dequeuer
func NewDequeuerWithMetrics ¶
NewDequeuerWithMetrics creates a new postgres queue dequeuer with the default metrics enabled
func NewQueuerWithMetrics ¶
NewQueuerWithMetrics creates a new postgres queue queuer with metrics enabled
func NewScheduler ¶
NewScheduler creates a new postgres task scheduler
func NewSchedulerWithMetrics ¶
NewScheduler creates a new postgres task scheduler with metrics enabled
func SetupTables ¶ added in v1.7.0
SetupTables sets up all the necessary tables, foreign keys and indexes.
This supports both: initial bootstrapping and changing of the reference list. However, it does not apply changes to an existing reference, this will do nothing.
Types ¶
type ForeignReference ¶
type ForeignReference struct { // ColumnName is a name of the colum in the `tasks` and `schedules` tables ColumnName string // ColumnType is a type of the colum in the `tasks` and `schedules` tables ColumnType string // ReferencedTable is a table name this column should be referencing ReferencedTable string // ReferencedColumn is a column name this column should be referencing ReferencedColumn string }
ForeignReference describes a foreign key reference in the queue system
Click to show internal directories.
Click to hide internal directories.