Documentation ¶
Index ¶
- Constants
- func JSONError(ctx *gin.Context, statusCode int, err error)
- func JSONErrorCode(ctx *gin.Context, statusCode int, code int, err error)
- func JSONErrorCodef(ctx *gin.Context, statusCode int, code int, format string, a ...interface{})
- func JSONErrorf(ctx *gin.Context, statusCode int, format string, a ...interface{})
- func JSONForbidden(ctx *gin.Context, format string, a ...interface{})
- func JSONForbiddenCode(ctx *gin.Context, code int, format string, a ...interface{})
- func JSONResponse(ctx *gin.Context, statusCode int, obj ...interface{})
- func JSONResponseBadRequest(ctx *gin.Context, obj ...interface{})
- func JSONResponseCollection(ctx *gin.Context, obj interface{})
- func JSONResponseInternalServerError(ctx *gin.Context, obj ...interface{})
- func JSONResponseNotImplemented(ctx *gin.Context)
- func JSONResponseOK(ctx *gin.Context, obj ...interface{})
- func JSONResponseObject(ctx *gin.Context, obj interface{})
- func JSONResponseValidationFailed(ctx *gin.Context, err error)
- type ResponseError
Constants ¶
View Source
const (
LocationHeaderKey = "Location"
)
Variables ¶
This section is empty.
Functions ¶
func JSONErrorCodef ¶
func JSONErrorf ¶
func JSONForbidden ¶
func JSONForbiddenCode ¶
func JSONResponse ¶
func JSONResponseBadRequest ¶
func JSONResponseCollection ¶
func JSONResponseOK ¶
func JSONResponseObject ¶
Types ¶
type ResponseError ¶
type ResponseError struct { Code int `json:"code,omitempty"` Message string `json:"error,omitempty"` }
func NewResponseError ¶
func NewResponseError(code int, message string) *ResponseError
func (*ResponseError) Error ¶
func (r *ResponseError) Error() error
Click to show internal directories.
Click to hide internal directories.