Documentation ¶
Index ¶
- func Abort(c *gin.Context, httpCode int, errorCode, errorMessage string)
- func AbortWithError(c *gin.Context, err error)
- func AbortWithForbiddenError(c *gin.Context, code, errMessage string)
- func AbortWithInternalError(c *gin.Context, message string)
- func AbortWithNotExistError(c *gin.Context, message string)
- func AbortWithRPCError(c *gin.Context, rpcError rpcerror.RPCError)
- func AbortWithRequestError(c *gin.Context, errorCode, errorMessage string)
- func AbortWithUnauthorized(c *gin.Context, code, errMessage string)
- func Success(c *gin.Context)
- func SuccessWithData(c *gin.Context, data interface{})
- type DataWithTotal
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbortWithError ¶
AbortWithError TODO: remove this function after all error changed to rpcerror.RPCError
func AbortWithForbiddenError ¶
func AbortWithInternalError ¶
func AbortWithNotExistError ¶
func AbortWithRequestError ¶
func AbortWithUnauthorized ¶
func SuccessWithData ¶
Types ¶
type DataWithTotal ¶
type DataWithTotal struct { Total int64 `json:"total"` Items interface{} `json:"items"` }
type Response ¶
type Response struct { ErrorCode string `json:"errorCode,omitempty"` ErrorMessage string `json:"errorMessage,omitempty"` Data interface{} `json:"data,omitempty"` RequestID string `json:"requestID,omitempty"` }
func NewResponse ¶
func NewResponse() *Response
func NewResponseWithData ¶
func NewResponseWithData(data interface{}) *Response
Click to show internal directories.
Click to hide internal directories.