validator

package
v0.0.0-...-a532a67 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InvalidEmail is key of invalid email message
	InvalidEmail = "email"
	// InvalidMaxLength is key for too long strings
	InvalidMaxLength = "length_max"
	// InvalidMinLength is key for too short strings
	InvalidMinLength = "length_min"
	// FieldIsRequired is key for required validation error message
	FieldIsRequired = "required"
)

Variables

This section is empty.

Functions

func EmailValid

func EmailValid(value string, basekey string, mm messages.MessageMap) error

EmailValid add error message if email is invalid

func IsEmail

func IsEmail(value string) bool

IsEmail return true if a strig value is a email

func MaxStringValid

func MaxStringValid(value string, basekey string, mm messages.MessageMap, max int) error

MaxStringValid add error message if string is longer then max

func MinStringValid

func MinStringValid(value string, basekey string, mm messages.MessageMap, min int) error

MinStringValid add error message if string is shorten then min

Types

This section is empty.

Jump to

Keyboard shortcuts

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