decode

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Form

func Form(r *http.Request, dst any) error

Form decodes the form values in an HTTP request into a struct.

func JSON

func JSON(w http.ResponseWriter, r *http.Request, dst interface{}) error

JSON decodes the JSON in an HTTP request into a struct. From: autostrada.dev

func JSONStrict

func JSONStrict(w http.ResponseWriter, r *http.Request, dst interface{}) error

JSONStrict decodes the JSON in an HTTP request into a struct, and From: autostrada.dev

func PostForm

func PostForm(r *http.Request, dst any) error

PostForm decodes the POST form values in an HTTP request into a struct.

func Query

func Query(r *http.Request, dst any) error

Query decodes the query string values in an HTTP request into a struct.

func QueryBool

func QueryBool(r *http.Request, key string) bool

QueryBool returns the value of a query string parameter as a bool in an HTTP request.

func QueryFloat64

func QueryFloat64(r *http.Request, key string) float64

QueryFloat64 returns the value of a query string parameter as a float64 in an HTTP request.

func QueryInt

func QueryInt(r *http.Request, key string) int

QueryInt returns the value of a query string parameter as an int in an HTTP request.

func QueryInt64

func QueryInt64(r *http.Request, key string) int64

QueryInt64 returns the value of a query string parameter as an int64 in an HTTP request.

func QueryIsTrue

func QueryIsTrue(r *http.Request, key string) bool

QueryIsTrue checks if a query string parameter is set to a truthy value.

func QueryString

func QueryString(r *http.Request, key string) string

QueryString returns the value of a query string parameter in an HTTP request.

func URLParamBool

func URLParamBool(r *http.Request, key string) bool

func URLParamFloat64

func URLParamFloat64(r *http.Request, key string) float64

func URLParamInt64

func URLParamInt64(r *http.Request, key string) int64

func URLParamString

func URLParamString(r *http.Request, key string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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