Documentation ¶
Index ¶
- Variables
- func Fail(c *gin.Context, err Response)
- func FailWithMsg(c *gin.Context, err Response, msg string)
- func Ok(c *gin.Context)
- func OkWithData(c *gin.Context, data interface{})
- func OkWithMsg(c *gin.Context, msg string)
- func Result(c *gin.Context, code int, msg string, data interface{})
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SUCCESS = Error(200, "success") NeedRedirect = Error(301, "need redirect") InvalidArgs = Error(400, "invalid params") Forbidden = Error(403, "forbidden") NotFound = Error(404, "not found") Conflict = Error(409, "entry exist") TooManyRequests = Error(429, "too many requests") ResultError = Error(500, "response error") DatabaseError = Error(598, "database error") CSRFDetected = Error(599, "csrf attack detected") UserError = Error(5001, "username or password error") CodeExpire = Error(5002, "verification expire") CodeError = Error(5003, "verification error") UserExist = Error(5004, "user Exist") )
Functions ¶
func OkWithData ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.