forms

package
v0.0.0-...-bf23469 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmailRX = regexp.MustCompile(`^[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,4}$`)

Functions

This section is empty.

Types

type Form

type Form struct {
	url.Values
	Errors errors
}

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, l int)

MaxLength Implement a MaxLength method to check that a specific field in the form doesn't exceed the required characters

func (*Form) MinLength

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

func (*Form) PermittedValues

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

func (*Form) Required

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

Required check if the field is empty or not

func (*Form) Valid

func (f *Form) Valid() bool

Jump to

Keyboard shortcuts

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