Documentation
¶
Index ¶
- Constants
- func Cors() gin.HandlerFunc
- func GetRealIP(c *gin.Context) string
- func Wrapper(handler HandlerFunc) func(c *gin.Context)
- type APIException
- func Exception(code int, message string, args ...interface{}) *APIException
- func GRPCError(s *status.Status) *APIException
- func NotFound() *APIException
- func ParameterError(message string) *APIException
- func ServerError() *APIException
- func UnauthorizedError() *APIException
- func UnknownError(message string) *APIException
- type HandlerFunc
Constants ¶
View Source
const ( SERVER_ERROR = 1000 // 系统错误 NOT_FOUND = 1001 // 401错误 UNKNOWN_ERROR = 1002 // 未知错误 PARAMETER_ERROR = 1003 // 参数错误 GRPC_ERROR = 1004 // 错误 AUTH_ERROR = 1005 // 认证错误 )
Variables ¶
This section is empty.
Functions ¶
func Cors ¶
func Cors() gin.HandlerFunc
func Wrapper ¶
func Wrapper(handler HandlerFunc) func(c *gin.Context)
Types ¶
type APIException ¶
type HandlerFunc ¶
Click to show internal directories.
Click to hide internal directories.