binding

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIMEJSON              = "application/json"
	MIMEMultipartPOSTForm = "multipart/form-data"
)

Variables

View Source
var (
	JSON          = jsonBinding{}
	Form          = formBinding{}
	Query         = queryBinding{}
	FormMultipart = formMultipartBinding{}
	Header        = headerBinding{}
)
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")
)
View Source
var (
	// ErrMultiFileHeader multipart.FileHeader invalid
	ErrMultiFileHeader = errors.New("unsupported field type for multipart.FileHeader")

	// ErrMultiFileHeaderLenInvalid array for []*multipart.FileHeader len invalid
	ErrMultiFileHeaderLenInvalid = errors.New("unsupported len of array for []*multipart.FileHeader")
)
View Source
var EnableDecoderDisallowUnknownFields = false
View Source
var EnableDecoderUseNumber = false

Functions

This section is empty.

Types

type Binding

type Binding interface {
	Name() string
	Bind(*http.Request, any) error
}

func Default added in v0.8.2

func Default(method, contentType string) Binding

type SliceValidationError

type SliceValidationError []error

func (SliceValidationError) Error

func (err SliceValidationError) Error() string

type StructValidator

type StructValidator interface {
	ValidateStruct(any) error
	Engine() any
}
var Validator StructValidator = &defaultValidator{}

Jump to

Keyboard shortcuts

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