binding

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationJSON = "application/json"
	ApplicationXML  = "application/xml"
	ApplicationForm = "application/x-www-form-urlencoded"
	MultipartForm   = "multipart/form-data"
)

Variables

View Source
var ErrNoValue = errors.New("no value")

Functions

func BindRequest

func BindRequest(req *http.Request, out interface{}) error

func GetRequestContentType

func GetRequestContentType(req *http.Request) string

Types

type Source

type Source interface {
	Get(key string) (V Source, err error)
	Map(iter func(key string, valuer Source))
	Array(iter func(index int, valuer Source) bool, beforeFs ...func(size int))
	String() (s string, err error)
	Int() (i int64, err error)
	Uint() (u uint64, err error)
	Float() (f float64, err error)
	Bool() (b bool, err error)
	Time() (t time.Time, err error)
	Duration() (d time.Duration, err error)
	File() (f *multipart.FileHeader, err error)
	Files() (f []*multipart.FileHeader, err error)
}

Jump to

Keyboard shortcuts

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