Documentation ¶
Index ¶
- Constants
- type Error
- func Forbidden(format string, v ...interface{}) *Error
- func InternalServer(format string, v ...interface{}) *Error
- func MethodNotAllowed(format string, v ...interface{}) *Error
- func MysqlConnectFailed(format string, v ...interface{}) *Error
- func New(code int, message string) *Error
- func NotFound(format string, v ...interface{}) *Error
- func Parse(errStr string) *Error
- func RedisConnectFailed(format string, v ...interface{}) *Error
- func Timeout(format string, v ...interface{}) *Error
- func Unauthorized(format string, v ...interface{}) *Error
Constants ¶
View Source
const ( MysqlConnectFailedCode = 1001 RedisConnectFailedCode = 1002 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
Error
func InternalServer ¶
InternalServerError generates a 500 error.
func MethodNotAllowed ¶
MethodNotAllowed generates a 405 error.
func MysqlConnectFailed ¶
MysqlConnectFailed
func Parse ¶
Parse tries to parse a JSON string into an error. If that fails, it will set the given string as the error detail.
func RedisConnectFailed ¶
RedisConnectFailed
func Unauthorized ¶
Unauthorized generates a 401 error.
Click to show internal directories.
Click to hide internal directories.