Documentation
¶
Overview ¶
Package ginx 提供一些 Gin 框架相关的工具
Index ¶
- func GetError(c *gin.Context) (err any, ok bool)
- func GetLang(c *gin.Context) i18n.Lang
- func GetLimit(c *gin.Context) int
- func GetOffset(c *gin.Context) int
- func GetPage(c *gin.Context) int
- func GetRequestID(c *gin.Context) string
- func GetTracer(c *gin.Context) trace.Tracer
- func GetUserID(c *gin.Context) string
- func SetErrResp(c *gin.Context, statusCode int, message string)
- func SetError(c *gin.Context, err error)
- func SetLang(c *gin.Context, lang i18n.Lang)
- func SetRequestID(c *gin.Context, requestID string)
- func SetResp(c *gin.Context, statusCode int, data any)
- func SetTracer(c *gin.Context, tracer trace.Tracer)
- func SetUserID(c *gin.Context, userID string)
- type PaginatedResp
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetErrResp ¶
SetErrResp 为指定的 gin.Context 设置错误响应数据
Types ¶
type PaginatedResp ¶
PaginatedResp 分页响应数据体
func NewPaginatedRespData ¶
func NewPaginatedRespData(count int64, results any) PaginatedResp
NewPaginatedRespData 创建分页响应数据体 注意:results 类型应该是 Slice / Array
Click to show internal directories.
Click to hide internal directories.