http

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("record not found")
)

Functions

func BadRequest

func BadRequest(c *gin.Context, err error)

BadRequest renders a HTTP 400 bad request response

func JsonOK

func JsonOK(c *gin.Context, data interface{})

JsonOK renders a successful response

func NotFound

func NotFound(c *gin.Context, err error)

NotFound renders a HTTP 404 not found response

func ServerError

func ServerError(c *gin.Context, err error)

ServerError renders a HTTP 500 error response

func ShouldReturn

func ShouldReturn(c *gin.Context, err error) bool

ShouldReturn is a shorthand method for handling resource errors

Types

This section is empty.

Jump to

Keyboard shortcuts

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