Documentation
¶
Overview ¶
Package formdata provides a way to safely and conveniently extract html Form data using a definied schema.
Index ¶
- Variables
- func Parse(data url.Values, schema Schema) error
- func ParseForm(r *http.Request, schema Schema) error
- type Parser
- func Bool(b *bool) Parser
- func BoolOr(b *bool, alt bool) Parser
- func Float(f *float64) Parser
- func FloatOr(f *float64, alt float64) Parser
- func Int(i *int) Parser
- func IntOr(i *int, alt int) Parser
- func Secret(s **conceal.Text) Parser
- func String(s *string) Parser
- func StringOr(s *string, alt string) Parser
- type Schema
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Parser ¶
A Parser implementation is capable of extracting a value from the value of an url.Values, which is a slice of string.
func Bool ¶
Bool is used to extract a form data value into a Go bool. If the value is not a bool or is missing than an error is returned during parsing.
func BoolOr ¶ added in v0.3.3
BoolOr is used to extract a form data value into a Go bool. If the value is missing, then the alt value is used instead.
func Float ¶
Float is used to extract a form data value into a Go float64. If the value is not a float or is missing then an error is returned during parsing.
func FloatOr ¶ added in v0.3.3
FloatOr is used to extract a form data value into a Go float64. If the value is missing, then the alt value is used instead.
func Int ¶
Int is used to extract a form data value into a Go int. If the value is not an int or is missing then an error is returned during parsing.
func IntOr ¶ added in v0.3.3
IntOr is used to extract a form data value into a Go int. If the value is missing, then the alt value is used instead.
func Secret ¶ added in v0.3.3
Secret is used to extract a form data value into a Go conceal.Text. If the value is missing then an error is returned during parsing.