Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // OK request is successful. OK = &Response{Code: http.StatusOK, Message: "ok"} // Err request is failed. Err = &Response{Code: http.StatusInternalServerError, Message: "unknown error"} )
Functions ¶
func AddErrorHandlingMiddleware ¶
func AddErrorHandlingMiddleware() gin.HandlerFunc
AddErrorHandlingMiddleware is used to add error handling middleware.
func EncodeJSON ¶
func EncodeJSON(_ context.Context, w http.ResponseWriter, response interface{}) error
EncodeJSON encode response to json.
Types ¶
Click to show internal directories.
Click to hide internal directories.