Documentation
¶
Index ¶
- func Bind(c *fasthttp.RequestCtx, obj interface{}) error
- func BindJSON(r *fasthttp.RequestCtx, obj interface{}) error
- func BindQuery(r *fasthttp.RequestCtx, obj interface{}) error
- func BindXML(r *fasthttp.RequestCtx, obj interface{}) error
- func BindYAML(r *fasthttp.RequestCtx, obj interface{}) error
- func GetToken(req *fasthttp.Request) string
- func MustBindWith(r *fasthttp.RequestCtx, obj interface{}, b binding.Binding) error
- func NewReq[REQ any](c *fasthttp.RequestCtx) (*REQ, error)
- func ShouldBind(r *fasthttp.RequestCtx, obj interface{}) error
- func ShouldBindJSON(r *fasthttp.RequestCtx, obj interface{}) error
- func ShouldBindQuery(r *fasthttp.RequestCtx, obj interface{}) error
- func ShouldBindWith(r *fasthttp.RequestCtx, obj interface{}, b binding.Binding) error
- func ShouldBindXML(r *fasthttp.RequestCtx, obj interface{}) error
- func ShouldBindYAML(r *fasthttp.RequestCtx, obj interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bind ¶ added in v1.3.0
func Bind(c *fasthttp.RequestCtx, obj interface{}) error
func BindJSON ¶ added in v1.3.0
func BindJSON(r *fasthttp.RequestCtx, obj interface{}) error
BindJSON is a shortcut for c.MustBindWith(obj, binding.JSON).
func BindQuery ¶ added in v1.3.0
func BindQuery(r *fasthttp.RequestCtx, obj interface{}) error
BindQuery is a shortcut for c.MustBindWith(obj, binding.Query).
func BindXML ¶ added in v1.3.0
func BindXML(r *fasthttp.RequestCtx, obj interface{}) error
BindXML is a shortcut for c.MustBindWith(obj, binding.BindXML).
func BindYAML ¶ added in v1.3.0
func BindYAML(r *fasthttp.RequestCtx, obj interface{}) error
BindYAML is a shortcut for c.MustBindWith(obj, binding.YAML).
func MustBindWith ¶ added in v1.3.0
func MustBindWith(r *fasthttp.RequestCtx, obj interface{}, b binding.Binding) error
MustBindWith binds the passed struct pointer using the specified binding engine. It will abort the request with HTTP 400 if any error occurs. See the binding package.
func ShouldBind ¶ added in v1.3.0
func ShouldBind(r *fasthttp.RequestCtx, obj interface{}) error
ShouldBind checks the Content-Type to select a binding engine automatically, Depending the "Content-Type" header different bindings are used:
"application/json" --> JSON binding "application/xml" --> XML binding
otherwise --> returns an error It parses the request's body as JSON if Content-Type == "application/json" using JSON or XML as a JSON input. It decodes the json payload into the struct specified as a pointer. Like c.GinBind() but this method does not set the response status code to 400 and abort if the json is not valid.
func ShouldBindJSON ¶ added in v1.3.0
func ShouldBindJSON(r *fasthttp.RequestCtx, obj interface{}) error
ShouldBindJSON is a shortcut for c.ShouldBindWith(obj, binding.JSON).
func ShouldBindQuery ¶ added in v1.3.0
func ShouldBindQuery(r *fasthttp.RequestCtx, obj interface{}) error
ShouldBindQuery is a shortcut for c.ShouldBindWith(obj, binding.Query).
func ShouldBindWith ¶ added in v1.3.0
func ShouldBindWith(r *fasthttp.RequestCtx, obj interface{}, b binding.Binding) error
ShouldBindWith binds the passed struct pointer using the specified binding engine. See the binding package.
func ShouldBindXML ¶ added in v1.3.0
func ShouldBindXML(r *fasthttp.RequestCtx, obj interface{}) error
ShouldBindXML is a shortcut for c.ShouldBindWith(obj, binding.XML).
func ShouldBindYAML ¶ added in v1.3.0
func ShouldBindYAML(r *fasthttp.RequestCtx, obj interface{}) error
ShouldBindYAML is a shortcut for c.ShouldBindWith(obj, binding.YAML).
Types ¶
This section is empty.