testutil

package
v0.0.0-...-10bbbd7 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: CC0-1.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRiverClient

func GetRiverClient(ctx context.Context, db *gorm.DB, dbConfig *db.DBConfig, workers *river.Workers, logger *slog.Logger) (*river.Client[*sql.Tx], error)

func InitTestDbConfig

func InitTestDbConfig() (*db.DBConfig, error)

func RequireInsertedTx

func RequireInsertedTx[TArgs river.JobArgs](ctx context.Context, tb testing.TB, tx *sql.Tx, expectedJob TArgs, opts *rivertest.RequireInsertedOpts) (*river.Job[TArgs], error)

func TestDbInit

func TestDbInit() (*gorm.DB, error)

Types

type MockLogHandler

type MockLogHandler struct {
	Records []slog.Record
}

func (*MockLogHandler) Enabled

func (h *MockLogHandler) Enabled(_ context.Context, _ slog.Level) bool

func (*MockLogHandler) Handle

func (h *MockLogHandler) Handle(_ context.Context, r slog.Record) error

func (*MockLogHandler) WithAttrs

func (h *MockLogHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*MockLogHandler) WithGroup

func (h *MockLogHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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