Documentation ¶
Index ¶
- Constants
- func BadRequest(ctx *gin.Context, detail string)
- func ConflictError(ctx *gin.Context, detail string)
- func Empty(ctx *gin.Context, statusCode int)
- func EmptyOK(ctx *gin.Context)
- func Errors(ctx *gin.Context, statusCode int, errs []*jsonapi.ErrorObject)
- func InternalServerError(ctx *gin.Context, detail string)
- func JSONAPIPayload(ctx *gin.Context, statusCode int, payload interface{})
- func JSONAPIPayloader(ctx *gin.Context, statusCode int, payload jsonapi.Payloader)
- func NoContent(ctx *gin.Context)
- func NotFoundError(ctx *gin.Context, detail string)
- func Unauthorized(ctx *gin.Context, detail string)
- func UnprocessableEntity(ctx *gin.Context, detail string)
- func ValidationErrors(ctx *gin.Context, errs []error)
Constants ¶
View Source
const (
// ContentTypeHeader is a name of header for Content-Type value
ContentTypeHeader = "Content-Type"
)
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
BadRequest renders Bad Request error
func ConflictError ¶
ConflictError renders Conflict error
func Errors ¶
func Errors(ctx *gin.Context, statusCode int, errs []*jsonapi.ErrorObject)
Errors renders errors in JSONAPI format
func InternalServerError ¶
InternalServerError renders Internal Server error
func JSONAPIPayload ¶
JSONAPIPayload is marshalling function for JSONAPI payload
func JSONAPIPayloader ¶
JSONAPIPayloader - renders internal already marshaled jsonapi struct
func NotFoundError ¶
NotFoundError renders Not Found error
func Unauthorized ¶
Unauthorized renders Unauthorized error
func UnprocessableEntity ¶
UnprocessableEntity renders Unprocessable Entity error
func ValidationErrors ¶
ValidationErrors renders validation errors with Unprocessable Entity status
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.