contextx

package
v2.0.37 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromDB

func FromDB(ctx context.Context) (*gorm.DB, bool)

FromDB 从上下文中获取DB

func FromNoTrans

func FromNoTrans(ctx context.Context) bool

FromNoTrans 从上下文中获取不使用事务标识

func FromTraceID

func FromTraceID(ctx context.Context) (string, bool)

FromTraceID 从上下文中获取追踪ID

func FromTrans

func FromTrans(ctx context.Context) (interface{}, bool)

FromTrans 从上下文中获取事务

func FromTransLock

func FromTransLock(ctx context.Context) bool

FromTransLock 从上下文中获取事务锁

func FromUserID

func FromUserID(ctx context.Context) (string, bool)

FromUserID 从上下文中获取用户ID

func NewDB

func NewDB(ctx context.Context, db *gorm.DB) context.Context

NewDB 创建DB的上下文

func NewNoTrans

func NewNoTrans(ctx context.Context) context.Context

NewNoTrans 创建不使用事务的上下文

func NewTraceID

func NewTraceID(ctx context.Context, traceID string) context.Context

NewTraceID 创建追踪ID的上下文

func NewTrans

func NewTrans(ctx context.Context, trans interface{}) context.Context

NewTrans 创建事务的上下文

func NewTransLock

func NewTransLock(ctx context.Context) context.Context

NewTransLock 创建事务锁的上下文

func NewUserID

func NewUserID(ctx context.Context, userID string) context.Context

NewUserID 创建用户ID的上下文

Types

This section is empty.

Jump to

Keyboard shortcuts

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