testfactory

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package testfactory provides low level helpers for inserting records directly into the database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Job

func Job_Build added in v0.5.0

func Job_Build(tb testing.TB, opts *JobOpts) *riverdriver.JobInsertFullParams

func Leader

func Queue added in v0.5.0

func Queue(ctx context.Context, tb testing.TB, exec riverdriver.Executor, opts *QueueOpts) *rivertype.Queue

Types

type JobOpts

type JobOpts struct {
	Attempt     *int
	AttemptedAt *time.Time
	CreatedAt   *time.Time
	EncodedArgs []byte
	Errors      [][]byte
	FinalizedAt *time.Time
	Kind        *string
	MaxAttempts *int
	Metadata    json.RawMessage
	Priority    *int
	Queue       *string
	ScheduledAt *time.Time
	State       *rivertype.JobState
	Tags        []string
	UniqueKey   []byte
}

type LeaderOpts

type LeaderOpts struct {
	ElectedAt *time.Time
	ExpiresAt *time.Time
	LeaderID  *string
}

type MigrationOpts

type MigrationOpts struct {
	Line    *string
	Version *int
}

type QueueOpts added in v0.5.0

type QueueOpts struct {
	Metadata  []byte
	Name      *string
	PausedAt  *time.Time
	UpdatedAt *time.Time
}

Jump to

Keyboard shortcuts

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