middlewares

package
v0.0.0-...-eddb447 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindJSONRequest

BindJSONRequest does the same job as ctx.ShouldBindJSON, while also writing a custom error to the response if the binding is not successful.

func BindQueryParams

BindQueryParams does the same job as ctx.ShouldBindQuery, while also writing a custom error to the response if the binding is not successful.

func ErrorHandler

func ErrorHandler() gin.HandlerFunc

ErrorHandler is a middleware which gets called when errors occur inside the handlers.

func GetMultipleURLParam

func GetMultipleURLParam(paramNames ...string) gin.HandlerFunc

GetMultipleURLParam is the same as GetURLParam, except it retrieves values for multiple URL parameters.

func GetURLParam

func GetURLParam(paramName string) gin.HandlerFunc

GetURLParam does the same job as ctx.Param, while also writing a custom error message if the param is not found or is not a valid integer.

For now, all URL params represent identifiers, which are integers.

func JSONApiContentType

func JSONApiContentType() gin.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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