Documentation ¶ Index ¶ Constants func Error(ctx *gin.Context, err error) func Error400(ctx *gin.Context) func Error500(ctx *gin.Context) func Fail(ctx *gin.Context, e *errs.Errors) func SetCookie(ctx *gin.Context, key string, value string, expire int64) func Success(ctx *gin.Context, data any) type Page type Result Constants ¶ View Source const OK = 200 Variables ¶ This section is empty. Functions ¶ func Error ¶ func Error(ctx *gin.Context, err error) func Error400 ¶ func Error400(ctx *gin.Context) func Error500 ¶ func Error500(ctx *gin.Context) func Fail ¶ func Fail(ctx *gin.Context, e *errs.Errors) func SetCookie ¶ func SetCookie(ctx *gin.Context, key string, value string, expire int64) func Success ¶ func Success(ctx *gin.Context, data any) Types ¶ type Page ¶ type Page struct { Total int64 `json:"total"` List any `json:"list"` PageSize int64 `json:"pageSize"` CurrentPage int64 `json:"currentPage"` } type Result ¶ type Result struct { Code int `json:"code"` Msg string `json:"msg"` Data any `json:"data"` } Source Files ¶ View all Source files code.goresponse.go Click to show internal directories. Click to hide internal directories.