render

package
v0.0.0-...-7fde5c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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

func BadRequest(ctx *gin.Context, detail string)

BadRequest renders Bad Request error

func ConflictError

func ConflictError(ctx *gin.Context, detail string)

ConflictError renders Conflict error

func Empty

func Empty(ctx *gin.Context, statusCode int)

Empty renders empty response with provided status

func EmptyOK

func EmptyOK(ctx *gin.Context)

EmptyOK renders empty response with 200 OK status

func Errors

func Errors(ctx *gin.Context, statusCode int, errs []*jsonapi.ErrorObject)

Errors renders errors in JSONAPI format

func InternalServerError

func InternalServerError(ctx *gin.Context, detail string)

InternalServerError renders Internal Server error

func JSONAPIPayload

func JSONAPIPayload(ctx *gin.Context, statusCode int, payload interface{})

JSONAPIPayload is marshalling function for JSONAPI payload

func JSONAPIPayloader

func JSONAPIPayloader(ctx *gin.Context, statusCode int, payload jsonapi.Payloader)

JSONAPIPayloader - renders internal already marshaled jsonapi struct

func NoContent

func NoContent(ctx *gin.Context)

NoContent renders NoContent response

func NotFoundError

func NotFoundError(ctx *gin.Context, detail string)

NotFoundError renders Not Found error

func Unauthorized

func Unauthorized(ctx *gin.Context, detail string)

Unauthorized renders Unauthorized error

func UnprocessableEntity

func UnprocessableEntity(ctx *gin.Context, detail string)

UnprocessableEntity renders Unprocessable Entity error

func ValidationErrors

func ValidationErrors(ctx *gin.Context, errs []error)

ValidationErrors renders validation errors with Unprocessable Entity status

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL