forms

package
v0.0.0-...-f39640c Latest Latest
Warning

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

Go to latest
Published: Jan 18, 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 {
	Errors formErrors
	// contains filtered or unexported fields
}

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 given form field is not empty

func (*Form) IsEmail

func (f *Form) IsEmail(field string)

func (*Form) MinLenght

func (f *Form) MinLenght(field string, minL int)

MinLenght checks that given field value has the minimum given chars

func (*Form) Required

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

Required iters over all given fields and checks that their values are not empty

func (*Form) Valid

func (f *Form) Valid() bool

Valid returns true if no errors found in form

Jump to

Keyboard shortcuts

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