forms

package
v0.0.0-...-40e0601 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmailRX = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+\\/=?]")

Functions

This section is empty.

Types

type Form

type Form struct {
	url.Values
	Errors errors
}

Holds validation errors for the form data.

func New

func New(data url.Values) *Form

func (*Form) MatchesPattern

func (f *Form) MatchesPattern(field string, pattern *regexp.Regexp)

func (*Form) MaxLength

func (f *Form) MaxLength(field string, d int)

func (*Form) MinLength

func (f *Form) MinLength(field string, d int)

func (*Form) PermittedValues

func (f *Form) PermittedValues(field string, opts ...string)

func (*Form) Required

func (f *Form) Required(fields ...string)

func (*Form) Valid

func (f *Form) Valid() bool

Implement a Valid method which returns true if there are no errors.

Jump to

Keyboard shortcuts

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