dbadaptertest

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 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 {
	JobCancelCalled              bool
	JobCancelTxCalled            bool
	JobInsertCalled              bool
	JobInsertTxCalled            bool
	JobInsertManyCalled          bool
	JobInsertManyTxCalled        bool
	JobGetCalled                 bool
	JobGetTxCalled               bool
	JobGetAvailableCalled        bool
	JobGetAvailableTxCalled      bool
	JobListCalled                bool
	JobListTxCalled              bool
	JobRetryImmediatelyCalled    bool
	JobRetryImmediatelyTxCalled  bool
	JobSetStateIfRunningCalled   bool
	LeadershipAttemptElectCalled bool
	LeadershipResignedCalled     bool

	JobCancelFunc              func(ctx context.Context, id int64) (*dbsqlc.RiverJob, error)
	JobCancelTxFunc            func(ctx context.Context, tx pgx.Tx, id int64) (*dbsqlc.RiverJob, 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)
	JobGetFunc                 func(ctx context.Context, id int64) (*dbsqlc.RiverJob, error)
	JobGetTxFunc               func(ctx context.Context, tx pgx.Tx, id int64) (*dbsqlc.RiverJob, 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)
	JobListFunc                func(ctx context.Context, params dbadapter.JobListParams) ([]*dbsqlc.RiverJob, error)
	JobListTxFunc              func(ctx context.Context, tx pgx.Tx, params dbadapter.JobListParams) ([]*dbsqlc.RiverJob, error)
	JobRetryImmediatelyFunc    func(ctx context.Context, id int64) (*dbsqlc.RiverJob, error)
	JobRetryImmediatelyTxFunc  func(ctx context.Context, tx pgx.Tx, id int64) (*dbsqlc.RiverJob, error)
	JobSetStateIfRunningFunc   func(ctx context.Context, params *dbadapter.JobSetStateIfRunningParams) (*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) JobCancel added in v0.0.17

func (ta *TestAdapter) JobCancel(ctx context.Context, id int64) (*dbsqlc.RiverJob, error)

func (*TestAdapter) JobCancelTx added in v0.0.17

func (ta *TestAdapter) JobCancelTx(ctx context.Context, tx pgx.Tx, id int64) (*dbsqlc.RiverJob, error)

func (*TestAdapter) JobGet added in v0.0.19

func (ta *TestAdapter) JobGet(ctx context.Context, id int64) (*dbsqlc.RiverJob, 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) JobGetTx added in v0.0.19

func (ta *TestAdapter) JobGetTx(ctx context.Context, tx pgx.Tx, id int64) (*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) JobList added in v0.0.17

func (ta *TestAdapter) JobList(ctx context.Context, params dbadapter.JobListParams) ([]*dbsqlc.RiverJob, error)

func (*TestAdapter) JobListTx added in v0.0.17

func (ta *TestAdapter) JobListTx(ctx context.Context, tx pgx.Tx, params dbadapter.JobListParams) ([]*dbsqlc.RiverJob, error)

func (*TestAdapter) JobRetryImmediately added in v0.0.19

func (ta *TestAdapter) JobRetryImmediately(ctx context.Context, id int64) (*dbsqlc.RiverJob, error)

func (*TestAdapter) JobRetryImmediatelyTx added in v0.0.19

func (ta *TestAdapter) JobRetryImmediatelyTx(ctx context.Context, tx pgx.Tx, id int64) (*dbsqlc.RiverJob, error)

func (*TestAdapter) JobSetStateIfRunning added in v0.0.13

func (ta *TestAdapter) JobSetStateIfRunning(ctx context.Context, params *dbadapter.JobSetStateIfRunningParams) (*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