Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EmailRX = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
Functions ¶
func Matches ¶
Matches checks if the given value matches the regular expression pattern. It returns true if there is a match, otherwise false.
func PermittedValue ¶
func PermittedValue[T comparable](value T, permittedValues ...T) bool
PermittedValue checks if the given value is present in the list of permitted values. It returns true if the value is found, otherwise false.
func Unique ¶
func Unique[T comparable](values []T) bool
Unique checks if the given slice of values contains only unique elements. It returns true if all elements are unique, and false otherwise.
Types ¶
type Validator ¶
func (*Validator) AddError ¶
AddError adds an error message to the Validator's Errors map. If the given key does not exist in the Errors map, it adds the key-value pair to the map. The key is used to identify the error, and the message provides a description of the error.
Click to show internal directories.
Click to hide internal directories.