dbadaptertest

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestAdapter

type TestAdapter struct {
	JobCompleteManyCalled          bool
	JobCompleteManyTxCalled        bool
	JobInsertCalled                bool
	JobInsertTxCalled              bool
	JobInsertManyCalled            bool
	JobInsertManyTxCalled          bool
	JobGetAvailableCalled          bool
	JobGetAvailableTxCalled        bool
	JobSetCancelledIfRunningCalled bool
	JobSetCompletedIfRunningCalled bool
	JobSetCompletedTxCalled        bool
	JobSetDiscardedIfRunningCalled bool
	JobSetErroredIfRunningCalled   bool
	JobSetSnoozedIfRunningCalled   bool
	LeadershipAttemptElectCalled   bool
	LeadershipResignedCalled       bool

	JobCompleteManyFunc          func(ctx context.Context, jobs ...dbadapter.JobToComplete) error
	JobCompleteManyTxFunc        func(ctx context.Context, tx pgx.Tx, jobs ...dbadapter.JobToComplete) error
	JobInsertFunc                func(ctx context.Context, params *dbadapter.JobInsertParams) (*dbadapter.JobInsertResult, error)
	JobInsertTxFunc              func(ctx context.Context, tx pgx.Tx, params *dbadapter.JobInsertParams) (*dbadapter.JobInsertResult, error)
	JobInsertManyFunc            func(ctx context.Context, params []*dbadapter.JobInsertParams) (int64, error)
	JobInsertManyTxFunc          func(ctx context.Context, tx pgx.Tx, params []*dbadapter.JobInsertParams) (int64, error)
	JobGetAvailableFunc          func(ctx context.Context, queueName string, limit int32) ([]*dbsqlc.RiverJob, error)
	JobGetAvailableTxFunc        func(ctx context.Context, tx pgx.Tx, queueName string, limit int32) ([]*dbsqlc.RiverJob, error)
	JobSetCancelledIfRunningFunc func(ctx context.Context, id int64, finalizedAt time.Time, err []byte) (*dbsqlc.RiverJob, error)
	JobSetCompletedIfRunningFunc func(ctx context.Context, job dbadapter.JobToComplete) (*dbsqlc.RiverJob, error)
	JobSetCompletedTxFunc        func(ctx context.Context, tx pgx.Tx, id int64, completedAt time.Time) (*dbsqlc.RiverJob, error)
	JobSetDiscardedIfRunningFunc func(ctx context.Context, id int64, finalizedAt time.Time, err []byte) (*dbsqlc.RiverJob, error)
	JobSetErroredIfRunningFunc   func(ctx context.Context, id int64, scheduledAt time.Time, err []byte) (*dbsqlc.RiverJob, error)
	JobSetSnoozedIfRunningFunc   func(ctx context.Context, id int64, scheduledAt time.Time) (*dbsqlc.RiverJob, error)
	LeadershipAttemptElectFunc   func(ctx context.Context) (bool, error)
	LeadershipResignFunc         func(ctx context.Context, name string, leaderID string) error
	// contains filtered or unexported fields
}

TestAdapter is an Adapter that allows any of its methods to be overridden, automatically falling back to the fallthroughAdapter if the method is not overridden.

func (*TestAdapter) JobCompleteMany

func (ta *TestAdapter) JobCompleteMany(ctx context.Context, jobs ...dbadapter.JobToComplete) error

func (*TestAdapter) JobCompleteManyTx

func (ta *TestAdapter) JobCompleteManyTx(ctx context.Context, tx pgx.Tx, jobs ...dbadapter.JobToComplete) error

func (*TestAdapter) JobGetAvailable

func (ta *TestAdapter) JobGetAvailable(ctx context.Context, queueName string, limit int32) ([]*dbsqlc.RiverJob, error)

func (*TestAdapter) JobGetAvailableTx

func (ta *TestAdapter) JobGetAvailableTx(ctx context.Context, tx pgx.Tx, queueName string, limit int32) ([]*dbsqlc.RiverJob, error)

func (*TestAdapter) JobInsert

func (*TestAdapter) JobInsertMany

func (ta *TestAdapter) JobInsertMany(ctx context.Context, params []*dbadapter.JobInsertParams) (int64, error)

func (*TestAdapter) JobInsertManyTx

func (ta *TestAdapter) JobInsertManyTx(ctx context.Context, tx pgx.Tx, params []*dbadapter.JobInsertParams) (int64, error)

func (*TestAdapter) JobInsertTx

func (ta *TestAdapter) JobInsertTx(ctx context.Context, tx pgx.Tx, params *dbadapter.JobInsertParams) (*dbadapter.JobInsertResult, error)

func (*TestAdapter) JobSetCancelledIfRunning

func (ta *TestAdapter) JobSetCancelledIfRunning(ctx context.Context, id int64, finalizedAt time.Time, err []byte) (*dbsqlc.RiverJob, error)

func (*TestAdapter) JobSetCompletedIfRunning

func (ta *TestAdapter) JobSetCompletedIfRunning(ctx context.Context, job dbadapter.JobToComplete) (*dbsqlc.RiverJob, error)

func (*TestAdapter) JobSetCompletedTx

func (ta *TestAdapter) JobSetCompletedTx(ctx context.Context, tx pgx.Tx, id int64, completedAt time.Time) (*dbsqlc.RiverJob, error)

func (*TestAdapter) JobSetDiscardedIfRunning

func (ta *TestAdapter) JobSetDiscardedIfRunning(ctx context.Context, id int64, finalizedAt time.Time, err []byte) (*dbsqlc.RiverJob, error)

func (*TestAdapter) JobSetErroredIfRunning

func (ta *TestAdapter) JobSetErroredIfRunning(ctx context.Context, id int64, scheduledAt time.Time, err []byte) (*dbsqlc.RiverJob, error)

func (*TestAdapter) JobSetSnoozedIfRunning

func (ta *TestAdapter) JobSetSnoozedIfRunning(ctx context.Context, id int64, scheduledAt time.Time) (*dbsqlc.RiverJob, error)

func (*TestAdapter) LeadershipAttemptElect

func (ta *TestAdapter) LeadershipAttemptElect(ctx context.Context, alreadyElected bool, name, leaderID string, ttl time.Duration) (bool, error)

func (*TestAdapter) LeadershipResign

func (ta *TestAdapter) LeadershipResign(ctx context.Context, name, leaderID string) error

Jump to

Keyboard shortcuts

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