Documentation
¶
Index ¶
Constants ¶
View Source
const ( DBErr ErrorCode = "db_err" JSONErr = "json_err" HTTPErr = "http_err" GenErr = "gen_err" )
Variables ¶
This section is empty.
Functions ¶
func PanicBadRequest ¶
func PanicConflict ¶
func PanicInternalError ¶
func PanicNotFound ¶
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
// in: body
Status int `json:"-"`
Code ErrorCode `json:"error_code"`
Msg string `json:"error_msg"`
}
swagger:model errorResponse
type Json ¶
type Json struct {
SetNoCacheHeaders bool
}
func (*Json) Handle ¶
func (c *Json) Handle(w http.ResponseWriter, r *http.Request, handler RequestHandler)
func (*Json) ParseJsonBody ¶
type RequestHandler ¶
type RequestHandler func() (status int, response interface{})
Click to show internal directories.
Click to hide internal directories.