binder

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSuitableContentNotFound = errors.New("binder: suitable content not found to parse body")
	ErrMapNotConvertable       = errors.New("binder: map is not convertable to map[string]string or map[string][]string")
)

Binder errors

View Source
var (
	HeaderBinder = &headerBinding{}
	CookieBinder = &cookieBinding{}
	QueryBinder  = &queryBinding{}
	FormBinder   = &formBinding{}
	URIBinder    = &uriBinding{}
	XMLBinder    = &xmlBinding{}
	JSONBinder   = &jsonBinding{}
)

Init default binders for Fiber

Functions

func FilterFlags

func FilterFlags(content string) string

Get content type from content type header

func SetParserDecoder

func SetParserDecoder(parserConfig ParserConfig)

SetParserDecoder allow globally change the option of form decoder, update decoderPool

Types

type ParserConfig

type ParserConfig struct {
	SetAliasTag       string
	ParserType        []ParserType
	IgnoreUnknownKeys bool
	ZeroEmpty         bool
}

ParserConfig form decoder config for SetParserDecoder

type ParserType

type ParserType struct {
	Customtype any
	Converter  func(string) reflect.Value
}

ParserType require two element, type and converter for register. Use ParserType with BodyParser for parsing custom type in form data.

Jump to

Keyboard shortcuts

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