binding

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIMEJSON              = "application/json"
	MIMEHTML              = "text/html"
	MIMEXML               = "application/xml"
	MIMEXML2              = "text/xml"
	MIMEPlain             = "text/plain"
	MIMEPOSTForm          = "application/x-www-form-urlencoded"
	MIMEMultipartPOSTForm = "multipart/form-data"
)

Content-Type MIME of the most common data formats.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

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

Binding describes the interface which needs to be implemented for binding the data present in the request such as JSON request body, query parameters or the form POST.

type BindingBody

type BindingBody interface {
	Binding
	BindBody([]byte, any) error
}

BindingBody adds BindBody method to Binding. BindBody is similar with Bind, but it reads the body from supplied bytes instead of req.Body.

type BindingUri

type BindingUri interface {
	Name() string
	BindUri(map[string][]string, any) error
}

BindingUri adds BindUri method to Binding. BindUri is similar with Bind, but it reads the Params.

Jump to

Keyboard shortcuts

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