forms

package
v0.0.0-...-ce9bc98 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Form

type Form struct {
	url.Values
	Errors errors
}

Form creates a custom form struct and embeds a url.Values object

func New

func New(data url.Values) *Form

New initializes a form struct

func (*Form) Has

func (f *Form) Has(field string, r *http.Request) bool

Has checks if form field is in post and not empty

func (*Form) HasValue

func (f *Form) HasValue(field string, r *http.Request) bool

Has checks if form field is in post and not empty

func (*Form) IsEmail

func (f *Form) IsEmail(field string)

Check for valid email address

func (*Form) MinLength

func (f *Form) MinLength(field string, length int, r *http.Request) bool

Check minimum length of string

func (*Form) Valid

func (f *Form) Valid() bool

Valid returns true if there are no errors, otherwise false

func (*Form) Validate

func (f *Form) Validate(fields []string, r *http.Request)

Validates passed fields

Jump to

Keyboard shortcuts

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