forms

package
v0.0.0-...-dc1493b Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: MIT Imports: 4 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, 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) bool

Has checks if form field is in post and not empty

func (*Form) IsEmail

func (f *Form) IsEmail(field string)

IsEmail checks for valid email address

func (*Form) MaxLength

func (f *Form) MaxLength(field string, length int) bool

MinLength checks for string minimum length

func (*Form) MinLength

func (f *Form) MinLength(field string, length int) bool

MinLength checks for string minimum length

func (*Form) Required

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

Required checks for required fields

func (*Form) Valid

func (f *Form) Valid() bool

Valid returns true if there are no errors, otherwise false

Jump to

Keyboard shortcuts

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