dbutil

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithTransaction

func WithTransaction(ctx context.Context, fn func(context.Context) error) error

WithTransaction runs fn with a transactional DB stored in ctx.

func WithTransactionRunner

func WithTransactionRunner(ctx context.Context, runner TransactionRunner) context.Context

WithTransactionRunner returns a context that uses runner for dbutil.WithTransaction.

Types

type TransactionRunner

type TransactionRunner func(context.Context, func(context.Context) error) error

TransactionRunner allows tests to mock the transaction boundary without a real database.

Jump to

Keyboard shortcuts

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