Documentation
¶
Index ¶
- Constants
- Variables
- func Bind(c *gin.Context, obj interface{}) error
- func BindBody(c *gin.Context, obj interface{}) error
- func BindQuery(c *gin.Context, obj interface{}) error
- func BindUri(r *gin.Context, obj interface{}) error
- func BindWith(c *gin.Context, obj interface{}, b Binding) error
- func NewReq[REQ any](c *gin.Context) (*REQ, error)
- func SetTag(tag string)
- func Validate(obj interface{}) error
- type Binding
Constants ¶
View Source
const ( MIMEPOSTForm = "application/x-www-form-urlencoded" MIMEMultipartPOSTForm = "multipart/form-data" )
Variables ¶
View Source
var ( Query = queryBinding{} FormPost = formPostBinding{} FormMultipart = formMultipartBinding{} Uri = uriBinding{} Header = headerBinding{} CustomBody = &bodyBinding{name: "json", unmarshaller: json.Unmarshal} )
These implement the Binding interface and can be used to bind the data present in the request to struct instances.
Functions ¶
func BindUri ¶ added in v0.12.0
ShouldBindUri binds the passed struct pointer using the specified binding engine.
Types ¶
Click to show internal directories.
Click to hide internal directories.