Documentation ¶
Index ¶
- Constants
- func GetPageIndex(c iris.Context) int
- func GetPageSize(c iris.Context) int
- func GetPaginationParam(c iris.Context) *schema.PaginationParam
- func GetToken(c iris.Context) string
- func GetTraceID(c iris.Context) string
- func GetUserID(c iris.Context) string
- func NewContext(c iris.Context) context.Context
- func ParseJSON(c iris.Context, obj interface{}) error
- func ResError(c iris.Context, err error, status ...int)
- func ResJSON(c iris.Context, status int, v interface{})
- func ResList(c iris.Context, v interface{})
- func ResOK(c iris.Context)
- func ResPage(c iris.Context, v interface{}, pr *schema.PaginationResult)
- func ResSuccess(c iris.Context, v interface{})
- func SetUserID(c iris.Context, userID string)
- type HandlerFunc
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 ¶
func GetPaginationParam ¶
func GetPaginationParam(c iris.Context) *schema.PaginationParam
GetPaginationParam 获取分页查询参数
Types ¶
type HandlerFunc ¶
Click to show internal directories.
Click to hide internal directories.