Documentation ¶
Index ¶
- Constants
- func GetToken(ctx context.Context) string
- func GetUserID(ctx context.Context) string
- func ParseForm(c *gin.Context, obj interface{}) error
- func ParseJSON(c, obj interface{}) error
- func ParseQuery(c *gin.Context, obj interface{}) error
- func ResError(c *gin.Context, err error, status ...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 *schema.PaginationResult)
- func ResSuccess(c *gin.Context, v interface{})
- func SetUserID(ctx context.Context, userID string)
Constants ¶
View Source
const ( UserIDKey = prefix + "/user-id" ReqBodyKey = prefix + "/req-body" ResBodyKey = prefix + "/res-body" LoggerReqBodyKey = prefix + "/logger-req-body" )
定义上下文中的键
View Source
const ( BASIC_SCHEMA string = "Basic " BEARER_SCHEMA string = "Bearer " )
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.