Documentation ¶
Index ¶
- Variables
- func SendError(ctx context.Context, w http.ResponseWriter, httpStatus int, errorMsg string)
- func SendErrorMethodNotAllowed(ctx context.Context, w http.ResponseWriter, url string, method string, ...)
- func SendErrorRootCause(ctx context.Context, w http.ResponseWriter, httpStatus int, errorType string, ...)
- func SendJson(ctx context.Context, w http.ResponseWriter, obj interface{})
- func SendJsonBytes(ctx context.Context, w http.ResponseWriter, bytes []byte)
- func SendJsonHttpReplySuccess(ctx context.Context, w http.ResponseWriter, obj interface{})
- type Body
- type ErrorRootCause
- type RootCause
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTypeParseException = "parse_exception" ErrTypeAuthException = "auth_exception" )
View Source
var ( ErrReasonRequestBodyIsRequired = "request body is required" ErrReasonAuthFailed = "fail to authenticate" ErrReasonAuthCodeNotFound = "fail to authenticate, auth code not found." ErrReasonAuthDecryptFailed = "fail to decrypt auth code, %s" ErrReasonUserNotFound = "user not found" ErrReasonIncorrectHttpMethod2 = "Incorrect HTTP method" ErrReasonIncorrectHttpMethod = "Incorrect HTTP method for uri [%s] and method [%s], allowed: [%s]" )
Functions ¶
func SendErrorRootCause ¶
func SendJsonBytes ¶
func SendJsonBytes(ctx context.Context, w http.ResponseWriter, bytes []byte)
func SendJsonHttpReplySuccess ¶
func SendJsonHttpReplySuccess(ctx context.Context, w http.ResponseWriter, obj interface{})
Types ¶
type ErrorRootCause ¶
Click to show internal directories.
Click to hide internal directories.