binder

package
v0.0.0-...-bf8f869 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	XML           = XMLBinder{}
	JSON          = JSONBinder{}
	Form          = FormBinder{"form"}
	Query         = QueryBinder{"query"}
	Header        = HeaderBinder{"header"}
	MultipartForm = MultipartFormBinder{"form"}
	Params        = ParamsBinder{"param"}
)

Functions

func Bind

func Bind(req *http.Request, dst interface{}) (err error)

func ParseForm

func ParseForm(req *http.Request, maxmem int64) error

Types

type Binder

type Binder interface {
	Bind(*http.Request, interface{}) error
}

type FormBinder

type FormBinder struct {
	TagName string
}

func (FormBinder) Bind

func (b FormBinder) Bind(req *http.Request, dst interface{}) (err error)

type HeaderBinder

type HeaderBinder struct {
	TagName string
}

func (HeaderBinder) Bind

func (b HeaderBinder) Bind(req *http.Request, dst interface{}) error

type JSONBinder

type JSONBinder struct{}

func (JSONBinder) Bind

func (b JSONBinder) Bind(req *http.Request, dst interface{}) error

type MultipartFormBinder

type MultipartFormBinder struct {
	TagName string
}

func (MultipartFormBinder) Bind

func (b MultipartFormBinder) Bind(req *http.Request, dst interface{}) (err error)

type ParamsBinder

type ParamsBinder struct {
	TagName string
}

func (ParamsBinder) Bind

func (b ParamsBinder) Bind(params map[string]string, dst interface{}) error

type QueryBinder

type QueryBinder struct {
	TagName string
}

func (QueryBinder) Bind

func (b QueryBinder) Bind(req *http.Request, dst interface{}) error

type XMLBinder

type XMLBinder struct{}

func (XMLBinder) Bind

func (b XMLBinder) Bind(req *http.Request, dst interface{}) error

Jump to

Keyboard shortcuts

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