bind

package
v0.5.1-rc2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrConvertMapStringSlice can not convert to map[string][]string.
	ErrConvertMapStringSlice = errors.New("can not convert to map slices of strings")

	// ErrConvertToMapString can not convert to map[string]string.
	ErrConvertToMapString = errors.New("can not convert to map of strings")
)

Functions

func MapFormWithTag

func MapFormWithTag(ptr any, form map[string][]string, tag string) error

func WithForm

func WithForm(c *gin.Context, r any) bool

WithForm binds the passed struct pointer using the request form params, fails with false returning and aborts the request with 400 status code.

func WithHeader

func WithHeader(c *gin.Context, r any) bool

WithHeader binds the passed struct pointer using the request header params, fails with false returning and aborts the request with 400 status code.

func WithJSON

func WithJSON(c *gin.Context, r any) bool

WithJSON binds the passed struct pointer using the request json params, fails with false returning and aborts the request with 400 status code.

func WithPath

func WithPath(c *gin.Context, r any) bool

WithPath binds the passed struct pointer using the request path params, fails with false returning and aborts the request with 400 status code.

func WithQuery

func WithQuery(c *gin.Context, r any) bool

WithQuery binds the passed struct pointer using the request query params, fails with false returning and aborts the request with 400 status code.

Types

This section is empty.

Jump to

Keyboard shortcuts

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