Documentation
¶
Index ¶
- type ClientCreateOrSetUpdatedAtParams
- type ClientQueueCreateOrSetUpdatedAtManyParams
- type ColumnExistsParams
- type DBTX
- type IndexExistsParams
- type IndexesExistParams
- type IndexesExistRow
- type JobCancelParams
- type JobCountByAllStatesRow
- type JobCountByQueueAndStateRow
- type JobDeleteBeforeParams
- type JobGetAvailableParams
- type JobGetStuckParams
- type JobInsertFastManyNoReturningParams
- type JobInsertFastManyParams
- type JobInsertFastManyRow
- type JobInsertFullManyParams
- type JobInsertFullParams
- type JobKindListParams
- type JobRescueManyParams
- type JobRetryParams
- type JobScheduleParams
- type JobScheduleRow
- type JobSetStateIfRunningManyParams
- type JobUpdateFullParams
- type JobUpdateParams
- type LeaderAttemptElectParams
- type LeaderAttemptReelectParams
- type LeaderInsertParams
- type LeaderResignParams
- type NullRiverJobState
- type PGNotifyManyParams
- type Queries
- func (q *Queries) ClientCreateOrSetUpdatedAt(ctx context.Context, db DBTX, arg *ClientCreateOrSetUpdatedAtParams) (*RiverClient, error)
- func (q *Queries) ClientQueueCreateOrSetUpdatedAtMany(ctx context.Context, db DBTX, arg *ClientQueueCreateOrSetUpdatedAtManyParams) (*RiverClientQueue, error)
- func (q *Queries) ColumnExists(ctx context.Context, db DBTX, arg *ColumnExistsParams) (bool, error)
- func (q *Queries) IndexExists(ctx context.Context, db DBTX, arg *IndexExistsParams) (bool, error)
- func (q *Queries) IndexesExist(ctx context.Context, db DBTX, arg *IndexesExistParams) ([]*IndexesExistRow, error)
- func (q *Queries) JobCancel(ctx context.Context, db DBTX, arg *JobCancelParams) (*RiverJob, error)
- func (q *Queries) JobCountByAllStates(ctx context.Context, db DBTX) ([]*JobCountByAllStatesRow, error)
- func (q *Queries) JobCountByQueueAndState(ctx context.Context, db DBTX, queueNames []string) ([]*JobCountByQueueAndStateRow, error)
- func (q *Queries) JobCountByState(ctx context.Context, db DBTX, state RiverJobState) (int64, error)
- func (q *Queries) JobDelete(ctx context.Context, db DBTX, id int64) (*RiverJob, error)
- func (q *Queries) JobDeleteBefore(ctx context.Context, db DBTX, arg *JobDeleteBeforeParams) (sql.Result, error)
- func (q *Queries) JobDeleteMany(ctx context.Context, db DBTX, max int32) ([]*RiverJob, error)
- func (q *Queries) JobGetAvailable(ctx context.Context, db DBTX, arg *JobGetAvailableParams) ([]*RiverJob, error)
- func (q *Queries) JobGetByID(ctx context.Context, db DBTX, id int64) (*RiverJob, error)
- func (q *Queries) JobGetByIDMany(ctx context.Context, db DBTX, id []int64) ([]*RiverJob, error)
- func (q *Queries) JobGetByKindMany(ctx context.Context, db DBTX, kind []string) ([]*RiverJob, error)
- func (q *Queries) JobGetStuck(ctx context.Context, db DBTX, arg *JobGetStuckParams) ([]*RiverJob, error)
- func (q *Queries) JobInsertFastMany(ctx context.Context, db DBTX, arg *JobInsertFastManyParams) ([]*JobInsertFastManyRow, error)
- func (q *Queries) JobInsertFastManyNoReturning(ctx context.Context, db DBTX, arg *JobInsertFastManyNoReturningParams) (int64, error)
- func (q *Queries) JobInsertFull(ctx context.Context, db DBTX, arg *JobInsertFullParams) (*RiverJob, error)
- func (q *Queries) JobInsertFullMany(ctx context.Context, db DBTX, arg *JobInsertFullManyParams) ([]*RiverJob, error)
- func (q *Queries) JobKindList(ctx context.Context, db DBTX, arg *JobKindListParams) ([]string, error)
- func (q *Queries) JobList(ctx context.Context, db DBTX, max int32) ([]*RiverJob, error)
- func (q *Queries) JobRescueMany(ctx context.Context, db DBTX, arg *JobRescueManyParams) error
- func (q *Queries) JobRetry(ctx context.Context, db DBTX, arg *JobRetryParams) (*RiverJob, error)
- func (q *Queries) JobSchedule(ctx context.Context, db DBTX, arg *JobScheduleParams) ([]*JobScheduleRow, error)
- func (q *Queries) JobSetStateIfRunningMany(ctx context.Context, db DBTX, arg *JobSetStateIfRunningManyParams) ([]*RiverJob, error)
- func (q *Queries) JobUpdate(ctx context.Context, db DBTX, arg *JobUpdateParams) (*RiverJob, error)
- func (q *Queries) JobUpdateFull(ctx context.Context, db DBTX, arg *JobUpdateFullParams) (*RiverJob, error)
- func (q *Queries) LeaderAttemptElect(ctx context.Context, db DBTX, arg *LeaderAttemptElectParams) (int64, error)
- func (q *Queries) LeaderAttemptReelect(ctx context.Context, db DBTX, arg *LeaderAttemptReelectParams) (int64, error)
- func (q *Queries) LeaderDeleteExpired(ctx context.Context, db DBTX, now *time.Time) (int64, error)
- func (q *Queries) LeaderGetElectedLeader(ctx context.Context, db DBTX) (*RiverLeader, error)
- func (q *Queries) LeaderInsert(ctx context.Context, db DBTX, arg *LeaderInsertParams) (*RiverLeader, error)
- func (q *Queries) LeaderResign(ctx context.Context, db DBTX, arg *LeaderResignParams) (int64, error)
- func (q *Queries) PGAdvisoryXactLock(ctx context.Context, db DBTX, key int64) error
- func (q *Queries) PGNotifyMany(ctx context.Context, db DBTX, arg *PGNotifyManyParams) error
- func (q *Queries) QueueCreateOrSetUpdatedAt(ctx context.Context, db DBTX, arg *QueueCreateOrSetUpdatedAtParams) (*RiverQueue, error)
- func (q *Queries) QueueDeleteExpired(ctx context.Context, db DBTX, arg *QueueDeleteExpiredParams) ([]*RiverQueue, error)
- func (q *Queries) QueueGet(ctx context.Context, db DBTX, name string) (*RiverQueue, error)
- func (q *Queries) QueueList(ctx context.Context, db DBTX, max int32) ([]*RiverQueue, error)
- func (q *Queries) QueueNameList(ctx context.Context, db DBTX, arg *QueueNameListParams) ([]string, error)
- func (q *Queries) QueuePause(ctx context.Context, db DBTX, arg *QueuePauseParams) (int64, error)
- func (q *Queries) QueueResume(ctx context.Context, db DBTX, arg *QueueResumeParams) (int64, error)
- func (q *Queries) QueueUpdate(ctx context.Context, db DBTX, arg *QueueUpdateParams) (*RiverQueue, error)
- func (q *Queries) RiverMigrationDeleteAssumingMainMany(ctx context.Context, db DBTX, version []int64) ([]*RiverMigrationDeleteAssumingMainManyRow, error)
- func (q *Queries) RiverMigrationDeleteByLineAndVersionMany(ctx context.Context, db DBTX, ...) ([]*RiverMigration, error)
- func (q *Queries) RiverMigrationGetAllAssumingMain(ctx context.Context, db DBTX) ([]*RiverMigrationGetAllAssumingMainRow, error)
- func (q *Queries) RiverMigrationGetByLine(ctx context.Context, db DBTX, line string) ([]*RiverMigration, error)
- func (q *Queries) RiverMigrationInsert(ctx context.Context, db DBTX, arg *RiverMigrationInsertParams) (*RiverMigration, error)
- func (q *Queries) RiverMigrationInsertMany(ctx context.Context, db DBTX, arg *RiverMigrationInsertManyParams) ([]*RiverMigration, error)
- func (q *Queries) RiverMigrationInsertManyAssumingMain(ctx context.Context, db DBTX, version []int64) ([]*RiverMigrationInsertManyAssumingMainRow, error)
- func (q *Queries) SchemaGetExpired(ctx context.Context, db DBTX, arg *SchemaGetExpiredParams) ([]string, error)
- func (q *Queries) TableExists(ctx context.Context, db DBTX, schemaAndTable string) (bool, error)
- type QueueCreateOrSetUpdatedAtParams
- type QueueDeleteExpiredParams
- type QueueNameListParams
- type QueuePauseParams
- type QueueResumeParams
- type QueueUpdateParams
- type RiverClient
- type RiverClientQueue
- type RiverJob
- type RiverJobState
- type RiverLeader
- type RiverMigration
- type RiverMigrationDeleteAssumingMainManyRow
- type RiverMigrationDeleteByLineAndVersionManyParams
- type RiverMigrationGetAllAssumingMainRow
- type RiverMigrationInsertManyAssumingMainRow
- type RiverMigrationInsertManyParams
- type RiverMigrationInsertParams
- type RiverQueue
- type SchemaGetExpiredParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientCreateOrSetUpdatedAtParams ¶ added in v0.10.0
type ClientQueueCreateOrSetUpdatedAtManyParams ¶ added in v0.10.0
type ColumnExistsParams ¶ added in v0.10.0
type IndexExistsParams ¶ added in v0.23.0
type IndexExistsParams struct {
Index string
Schema sql.NullString
}
type IndexesExistParams ¶ added in v0.24.0
type IndexesExistParams struct {
Schema sql.NullString
IndexNames []string
}
type IndexesExistRow ¶ added in v0.24.0
type JobCancelParams ¶ added in v0.0.23
type JobCountByAllStatesRow ¶ added in v0.24.0
type JobCountByAllStatesRow struct {
State RiverJobState
Count int64
}
type JobCountByQueueAndStateRow ¶ added in v0.24.0
type JobDeleteBeforeParams ¶ added in v0.0.23
type JobGetAvailableParams ¶ added in v0.0.23
type JobGetStuckParams ¶ added in v0.0.23
type JobInsertFastManyNoReturningParams ¶ added in v0.12.0
type JobInsertFastManyParams ¶ added in v0.10.0
type JobInsertFastManyRow ¶ added in v0.12.0
type JobInsertFullManyParams ¶ added in v0.23.0
type JobInsertFullManyParams struct {
Args []string
Attempt []int16
AttemptedAt []time.Time
CreatedAt []time.Time
FinalizedAt []time.Time
Kind []string
MaxAttempts []int16
Metadata []string
Priority []int16
Queue []string
ScheduledAt []time.Time
State []string
Tags []string
UniqueKey []string
UniqueStates []int32
}
type JobInsertFullParams ¶ added in v0.0.23
type JobInsertFullParams struct {
Args string
Attempt int16
AttemptedAt *time.Time
AttemptedBy []string
CreatedAt *time.Time
Errors []string
FinalizedAt *time.Time
Kind string
MaxAttempts int16
Metadata string
Priority int16
Queue string
ScheduledAt *time.Time
State RiverJobState
Tags []string
UniqueKey string
UniqueStates int32
}
type JobKindListParams ¶ added in v0.24.0
type JobRescueManyParams ¶ added in v0.0.23
type JobRetryParams ¶ added in v0.23.0
type JobScheduleParams ¶ added in v0.0.23
type JobScheduleRow ¶ added in v0.12.0
type JobSetStateIfRunningManyParams ¶ added in v0.12.1
type JobSetStateIfRunningManyParams struct {
IDs []int64
AttemptDoUpdate []bool
Attempt []int32
ErrorsDoUpdate []bool
Errors []string
FinalizedAtDoUpdate []bool
FinalizedAt []time.Time
MetadataDoMerge []bool
MetadataUpdates []string
ScheduledAtDoUpdate []bool
ScheduledAt []time.Time
State []string
Now *time.Time
}
type JobUpdateFullParams ¶ added in v0.29.0
type JobUpdateFullParams struct {
AttemptDoUpdate bool
Attempt int16
AttemptedAtDoUpdate bool
AttemptedAt *time.Time
AttemptedByDoUpdate bool
AttemptedBy []string
ErrorsDoUpdate bool
Errors []string
FinalizedAtDoUpdate bool
FinalizedAt *time.Time
MaxAttemptsDoUpdate bool
MaxAttempts int16
MetadataDoUpdate bool
Metadata string
StateDoUpdate bool
State RiverJobState
ID int64
}
type JobUpdateParams ¶ added in v0.0.23
type LeaderAttemptElectParams ¶ added in v0.0.23
type LeaderAttemptReelectParams ¶ added in v0.0.23
type LeaderInsertParams ¶ added in v0.0.23
type LeaderResignParams ¶ added in v0.0.23
type LeaderResignParams struct {
LeaderID string
Schema sql.NullString
LeadershipTopic string
}
type NullRiverJobState ¶ added in v0.10.0
type NullRiverJobState struct {
RiverJobState RiverJobState
Valid bool // Valid is true if RiverJobState is not NULL
}
func (*NullRiverJobState) Scan ¶ added in v0.10.0
func (ns *NullRiverJobState) Scan(value interface{}) error
Scan implements the Scanner interface.
type PGNotifyManyParams ¶ added in v0.5.0
type PGNotifyManyParams struct {
Schema sql.NullString
Topic string
Payload []string
}
type Queries ¶
type Queries struct {
}
func (*Queries) ClientCreateOrSetUpdatedAt ¶ added in v0.10.0
func (q *Queries) ClientCreateOrSetUpdatedAt(ctx context.Context, db DBTX, arg *ClientCreateOrSetUpdatedAtParams) (*RiverClient, error)
func (*Queries) ClientQueueCreateOrSetUpdatedAtMany ¶ added in v0.10.0
func (q *Queries) ClientQueueCreateOrSetUpdatedAtMany(ctx context.Context, db DBTX, arg *ClientQueueCreateOrSetUpdatedAtManyParams) (*RiverClientQueue, error)
func (*Queries) ColumnExists ¶ added in v0.10.0
func (*Queries) IndexExists ¶ added in v0.23.0
func (*Queries) IndexesExist ¶ added in v0.24.0
func (q *Queries) IndexesExist(ctx context.Context, db DBTX, arg *IndexesExistParams) ([]*IndexesExistRow, error)
func (*Queries) JobCountByAllStates ¶ added in v0.24.0
func (*Queries) JobCountByQueueAndState ¶ added in v0.24.0
func (*Queries) JobCountByState ¶ added in v0.1.0
func (*Queries) JobDeleteBefore ¶ added in v0.0.23
func (*Queries) JobDeleteMany ¶ added in v0.24.0
this last SELECT step is necessary because there's no other way to define order records come back from a DELETE statement
func (*Queries) JobGetAvailable ¶ added in v0.0.23
func (*Queries) JobGetByID ¶ added in v0.0.23
func (*Queries) JobGetByIDMany ¶ added in v0.0.23
func (*Queries) JobGetByKindMany ¶ added in v0.0.23
func (*Queries) JobGetStuck ¶ added in v0.0.23
func (*Queries) JobInsertFastMany ¶ added in v0.10.0
func (q *Queries) JobInsertFastMany(ctx context.Context, db DBTX, arg *JobInsertFastManyParams) ([]*JobInsertFastManyRow, error)
func (*Queries) JobInsertFastManyNoReturning ¶ added in v0.12.0
func (*Queries) JobInsertFull ¶ added in v0.0.23
func (*Queries) JobInsertFullMany ¶ added in v0.23.0
func (*Queries) JobKindList ¶ added in v0.24.0
func (*Queries) JobRescueMany ¶ added in v0.0.23
Run by the rescuer to queue for retry or discard depending on job state.
func (*Queries) JobSchedule ¶ added in v0.0.23
func (q *Queries) JobSchedule(ctx context.Context, db DBTX, arg *JobScheduleParams) ([]*JobScheduleRow, error)
func (*Queries) JobSetStateIfRunningMany ¶ added in v0.12.1
func (*Queries) JobUpdateFull ¶ added in v0.29.0
func (q *Queries) JobUpdateFull(ctx context.Context, db DBTX, arg *JobUpdateFullParams) (*RiverJob, error)
A generalized update for any property on a job. This brings in a large number of parameters and therefore may be more suitable for testing than production.
func (*Queries) LeaderAttemptElect ¶ added in v0.0.23
func (*Queries) LeaderAttemptReelect ¶ added in v0.0.23
func (*Queries) LeaderDeleteExpired ¶ added in v0.0.23
func (*Queries) LeaderGetElectedLeader ¶ added in v0.0.23
func (*Queries) LeaderInsert ¶ added in v0.0.23
func (q *Queries) LeaderInsert(ctx context.Context, db DBTX, arg *LeaderInsertParams) (*RiverLeader, error)
func (*Queries) LeaderResign ¶ added in v0.0.23
func (*Queries) PGAdvisoryXactLock ¶ added in v0.0.23
func (*Queries) PGNotifyMany ¶ added in v0.5.0
func (*Queries) QueueCreateOrSetUpdatedAt ¶ added in v0.10.0
func (q *Queries) QueueCreateOrSetUpdatedAt(ctx context.Context, db DBTX, arg *QueueCreateOrSetUpdatedAtParams) (*RiverQueue, error)
func (*Queries) QueueDeleteExpired ¶ added in v0.10.0
func (q *Queries) QueueDeleteExpired(ctx context.Context, db DBTX, arg *QueueDeleteExpiredParams) ([]*RiverQueue, error)
func (*Queries) QueueNameList ¶ added in v0.24.0
func (*Queries) QueuePause ¶ added in v0.10.0
func (*Queries) QueueResume ¶ added in v0.10.0
func (*Queries) QueueUpdate ¶ added in v0.20.0
func (q *Queries) QueueUpdate(ctx context.Context, db DBTX, arg *QueueUpdateParams) (*RiverQueue, error)
func (*Queries) RiverMigrationDeleteAssumingMainMany ¶ added in v0.10.0
func (*Queries) RiverMigrationDeleteByLineAndVersionMany ¶ added in v0.10.0
func (q *Queries) RiverMigrationDeleteByLineAndVersionMany(ctx context.Context, db DBTX, arg *RiverMigrationDeleteByLineAndVersionManyParams) ([]*RiverMigration, error)
func (*Queries) RiverMigrationGetAllAssumingMain ¶ added in v0.10.0
func (q *Queries) RiverMigrationGetAllAssumingMain(ctx context.Context, db DBTX) ([]*RiverMigrationGetAllAssumingMainRow, error)
This is a compatibility query for getting existing migrations before the `line` column was added to the table in version 005. We need to make sure to only select non-line properties so the query doesn't error on older schemas. (Even if we use `SELECT *` below, sqlc materializes it to a list of column names in the generated query.)
func (*Queries) RiverMigrationGetByLine ¶ added in v0.10.0
func (*Queries) RiverMigrationInsert ¶
func (q *Queries) RiverMigrationInsert(ctx context.Context, db DBTX, arg *RiverMigrationInsertParams) (*RiverMigration, error)
func (*Queries) RiverMigrationInsertMany ¶
func (q *Queries) RiverMigrationInsertMany(ctx context.Context, db DBTX, arg *RiverMigrationInsertManyParams) ([]*RiverMigration, error)
func (*Queries) RiverMigrationInsertManyAssumingMain ¶ added in v0.10.0
func (*Queries) SchemaGetExpired ¶ added in v0.21.0
type QueueCreateOrSetUpdatedAtParams ¶ added in v0.10.0
type QueueDeleteExpiredParams ¶ added in v0.10.0
type QueueNameListParams ¶ added in v0.24.0
type QueuePauseParams ¶ added in v0.23.0
type QueueResumeParams ¶ added in v0.23.0
type QueueUpdateParams ¶ added in v0.20.0
type RiverClient ¶ added in v0.10.0
type RiverClientQueue ¶ added in v0.10.0
type RiverJob ¶ added in v0.0.23
type RiverJob struct {
ID int64
Args string
Attempt int16
AttemptedAt *time.Time
AttemptedBy []string
CreatedAt time.Time
Errors []string
FinalizedAt *time.Time
Kind string
MaxAttempts int16
Metadata string
Priority int16
Queue string
State RiverJobState
ScheduledAt time.Time
Tags []string
UniqueKey []byte
UniqueStates *int
}
type RiverJobState ¶ added in v0.10.0
type RiverJobState string
const ( RiverJobStateAvailable RiverJobState = "available" RiverJobStateCancelled RiverJobState = "cancelled" RiverJobStateCompleted RiverJobState = "completed" RiverJobStateDiscarded RiverJobState = "discarded" RiverJobStatePending RiverJobState = "pending" RiverJobStateRetryable RiverJobState = "retryable" RiverJobStateRunning RiverJobState = "running" RiverJobStateScheduled RiverJobState = "scheduled" )
func (*RiverJobState) Scan ¶ added in v0.10.0
func (e *RiverJobState) Scan(src interface{}) error
type RiverLeader ¶ added in v0.0.23
type RiverMigrationDeleteAssumingMainManyRow ¶ added in v0.10.0
type RiverMigrationDeleteByLineAndVersionManyParams ¶ added in v0.10.0
type RiverMigrationGetAllAssumingMainRow ¶ added in v0.10.0
type RiverMigrationInsertManyAssumingMainRow ¶ added in v0.10.0
type RiverMigrationInsertManyParams ¶ added in v0.10.0
type RiverMigrationInsertParams ¶ added in v0.10.0
type RiverQueue ¶ added in v0.10.0
type SchemaGetExpiredParams ¶ added in v0.21.0
type SchemaGetExpiredParams struct {
Prefix interface{}
BeforeName interface{}
}