transaction

package
v0.0.0-...-1bf90d9 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxKey key = "tx"
)

Variables

This section is empty.

Functions

func CheckTx

func CheckTx(ctx context.Context) (
	tx pgx.Tx, found bool,
)

func CreateTx

func CreateTx(ctx context.Context, dbc TxStarter, options pgx.TxOptions) (
	tx pgx.Tx,
	commit func(ctx context.Context) error,
	rollback func(ctx context.Context) error,
	err error,
)

Types

type TxManager

type TxManager interface {
	ReadCommitted(ctx context.Context, f func(ctx context.Context) error) error
}

func NewTransactionManager

func NewTransactionManager(db *pg.Client) TxManager

type TxStarter

type TxStarter interface {
	BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error)
}

Jump to

Keyboard shortcuts

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