handlers

package
v0.0.0-...-663df1f Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2018 License: MIT Imports: 6 Imported by: 0

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

func MethodNotAllowed() func(c *gin.Context)

MethodNotAllowed is the 405 handler

func NotFound

func NotFound() func(c *gin.Context)

NotFound is the 404 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

Jump to

Keyboard shortcuts

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