Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context interface {
context.Context
// 获取DB实例
DB() db.DB
// 获取日志实例
Logger() utillog.Logger
// 获取当前登录用户ID
UserID() int
// 获取请求ID
RequestID() string
// 取消
Cancel()
// 设置Context
SetContext(context.Context)
// 设置用户ID
SetUserID(userID int)
// 设置请求ID
SetRequestID(string)
// 返回一个新的Context,并设置tx
NewWithTx(db.DB) Context
}
Context 上下文
Click to show internal directories.
Click to hide internal directories.