Documentation
¶
Index ¶
- Constants
- func DisableResponseRecover()
- func EnableResponseRecover()
- func Fail(ctx *gin.Context)
- func FailAndAbort(ctx *gin.Context)
- func FailWithCode(ctx *gin.Context, code int, msg string)
- func FailWithCodeAndAbort(ctx *gin.Context, code int, msg string)
- func FailWithCodeAndNeedReload(ctx *gin.Context, code int, msg string)
- func FailWithCodeAndNeedReloadAndAbort(ctx *gin.Context, code int, msg string)
- func FailWithData(ctx *gin.Context, data interface{})
- func FailWithDataAndAbort(ctx *gin.Context, data interface{})
- func FailWithDetail(ctx *gin.Context, msg string, data interface{}, showTime ...int64)
- func FailWithDetailAndAbort(ctx *gin.Context, msg string, data interface{}, showTime ...int64)
- func FailWithError(ctx *gin.Context, err error, showTime ...int64)
- func FailWithErrorAndAbort(ctx *gin.Context, err error, showTime ...int64)
- func FailWithMsg(ctx *gin.Context, msg string, showTime ...int64)
- func FailWithMsgAndAbort(ctx *gin.Context, msg string, showTime ...int64)
- func IsUseResponseRecover() bool
- func Ok(ctx *gin.Context)
- func OkWithData(ctx *gin.Context, data interface{})
- func OkWithDetail(ctx *gin.Context, msg string, data interface{}, showTime ...int64)
- func OkWithMsg(ctx *gin.Context, msg string, showTime ...int64)
- func OkWithPageData(ctx *gin.Context, count int64, data interface{})
- type CRUDResponse
- type PageData
- type PageResponse
- type Response
- type ResponseAbort
Constants ¶
View Source
const ( SuccessStatus = 0 FailStatus = -1 MsgOK = "ok" MsgFail = "fail" )
Variables ¶
This section is empty.
Functions ¶
func DisableResponseRecover ¶
func DisableResponseRecover()
func EnableResponseRecover ¶
func EnableResponseRecover()
func FailAndAbort ¶
func FailWithData ¶
func FailWithDataAndAbort ¶
func FailWithDetail ¶
func FailWithDetailAndAbort ¶
func FailWithErrorAndAbort ¶
func FailWithMsgAndAbort ¶
func IsUseResponseRecover ¶
func IsUseResponseRecover() bool
func OkWithData ¶
func OkWithDetail ¶
func OkWithPageData ¶
Types ¶
type CRUDResponse ¶
type PageResponse ¶
type ResponseAbort ¶
type ResponseAbort struct{}
ResponseAbort is used ONLY to stop gin handler chain after response has been written. It MUST be recovered by middleware.ResponseRecover.
Click to show internal directories.
Click to hide internal directories.