transactions

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TransactionManager

type TransactionManager interface {
	// Transaction 开启事务上下文
	Transaction(ctx context.Context, fn func(ctx context.Context) error) error
	// GetTx 从上下文中获取事务
	GetTx(ctx context.Context) *gorm.DB
}

TransactionManager 事务管理器

func NewGormTransactionManager

func NewGormTransactionManager() TransactionManager

NewGormTransactionManager 创建GORM事务管理器

type TxKey

type TxKey struct{}

TxKey 事务上下文的key

Jump to

Keyboard shortcuts

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