Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(errs ...*jsonapi.ErrorObject) func(c *gin.Context)
Error is a Gin handler func to create an error response
func MethodNotAllowed ¶
MethodNotAllowed is the 405 handler
Types ¶
type ErrorBuilder ¶
type ErrorBuilder struct {
Errors []*jsonapi.ErrorObject
}
ErrorBuilder is a struct carrying jsonapi errors
func NewErrorBuilder ¶
func NewErrorBuilder() *ErrorBuilder
NewErrorBuilder returns a pointer to an ErrorBuilder
func (*ErrorBuilder) AddError ¶
func (b *ErrorBuilder) AddError(status int, detail string)
AddError makes it easier to add a simple jsonapi error to the builder
Click to show internal directories.
Click to hide internal directories.