Built-in Is Validators
Validators (Only Is Functions)
IsNotEmpty
Checks if a value is not empty.
Usage Example:
IsAlphanumeric
Checks if a string contains only alphanumeric characters.
Usage Example:
IsEmail
Checks if a string is a valid email address.
Usage Example:
IsIn(allowedValues ...interface)
Checks if a value is in a predefined list of allowed values.
Usage Example:
IsString
Checks if a value is a string.
Usage Example:
IsNumber
Checks if a value is a number (int or float).
Usage Example:
IsInt
Checks if a value is an integer.
Usage Example:
IsFloat
Checks if a value is a float.
Usage Example:
IsBool
Checks if a value is a boolean.
Usage Example:
IsSlice
Checks if a value is a slice.
Usage Example:
IsMap
Checks if a value is a map.
Usage Example:
IsURL
Checks if a string is a valid URL.
Usage Example:
IsUUID
Checks if a string is a valid UUID.
Usage Example:
IsDate
Checks if a string is a valid date in the format YYYY-MM-DD
.
Usage Example:
IsTime
Checks if a string is a valid time in the format HH:MM:SS
.
Usage Example:
IsCreditCard
Checks if a string is a valid credit card number using the Luhn algorithm.
Usage Example:
IsHexColor
Checks if a string is a valid hexadecimal color code.
Usage Example:
IsJSON
Checks if a string is valid JSON.
Usage Example:
IsIP
Checks if a string is a valid IP address (IPv4 or IPv6).
Usage Example:
IsAlpha
Checks if a string contains only alphabetic characters.
Usage Example:
IsAlphaNumeric
Checks if a string contains only alphanumeric characters.
Usage Example:
IsArabic
Checks if a string contains only Arabic characters (including spaces and common Arabic punctuation).
Usage Example:
IsAlphaArabic
Checks if a string contains only Arabic and Latin alphabetic characters.
Usage Example:
IsBase64
Checks if a string is valid Base64-encoded data.
Usage Example:
IsBase64Image
Checks if a string is valid Base64-encoded image data.
Usage Example: