Documentation ¶
Overview ¶
Package trans gorm 事务封装
Index ¶
- func ExecTrans(ctx context.Context, db *gorm.DB, f Func) error
- func ExecTransWithLock(ctx context.Context, db *gorm.DB, cb Func) error
- func FromTransCtx(ctx context.Context) interface{}
- func FromTransLockCtx(ctx context.Context) bool
- func NewTransCtx(ctx context.Context, trans interface{}) context.Context
- func NewTransLockCtx(ctx context.Context) context.Context
- type Func
- type Trans
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecTransWithLock ¶
ExecTransWithLock 执行事务(加锁)
func FromTransCtx ¶ added in v2.0.1
FromTransCtx 从上下文中获取事务
func FromTransLockCtx ¶ added in v2.0.1
FromTransLockCtx 从上下文中获取事务锁
func NewTransCtx ¶ added in v2.0.1
NewTransCtx 创建事务的上下文
Types ¶
Click to show internal directories.
Click to hide internal directories.