Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorWithCode ¶
func ErrorWithCode(c *gin.Context, code ResponseCode, msg string)
func GinResponseObj ¶
func GinResponseObj(o *ResponseObj) gin.H
GinResponseObj convert ResponseObj into gin.H
Types ¶
type ResponseCode ¶
type ResponseCode int32
ResponseCode define the new type for response code
const ( // RSuccess is success status RSuccess ResponseCode = 200 // Client Error RClientError ResponseCode = 400 // Server Error RServerError ResponseCode = 500 // ROther is other status ROther )
type ResponseObj ¶
type ResponseObj struct { Code ResponseCode `json:"code"` Data interface{} `json:"data"` }
ResponseObj define a response object
Click to show internal directories.
Click to hide internal directories.