Documentation ¶
Index ¶
- Constants
- func GetToken(c *gin.Context) string
- func GetTraceID(c *gin.Context) string
- func GetUserID(c *gin.Context) string
- func NewContext(c *gin.Context) context.Context
- func ParseForm(c *gin.Context, obj interface{}) error
- func ParseJSON(c *gin.Context, obj interface{}) error
- func ParseQuery(c *gin.Context, obj interface{}) error
- func ResError(c *gin.Context, err error, codes ...int)
- func ResJSON(c *gin.Context, status int, v interface{})
- func ResList(c *gin.Context, v interface{})
- func ResOK(c *gin.Context)
- func ResPage(c *gin.Context, v interface{}, pr *dao.PaginationResult)
- func ResSuccess(c *gin.Context, v interface{})
- func SetUserID(c *gin.Context, userID string)
Constants ¶
View Source
const ( // UserIDKey 存储上下文中的键(用户ID) UserIDKey = prefix + "/user-id" // TraceIDKey 存储上下文中的键(跟踪ID) TraceIDKey = prefix + "/trace-id" // ResBodyKey 存储上下文中的键(响应Body数据) ResBodyKey = prefix + "/res-body" )
定义上下文中的键
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.