Documentation ¶
Overview ¶
Package validators contain helper functions for validation of fields and values
Index ¶
- func GetValidationErrMsg(s any, err error) (errMsg string)
- func IsValidationError(err error) bool
- func ValidateCountryCode(country string) error
- func ValidateCurrencyCode(code string) error
- func ValidateEmail(email string) error
- func ValidatePhoneNumber(phoneNumber string) error
- func ValidateUrl(url string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetValidationErrMsg ¶
GetValidationErrMsg checks to see if the provided err is a validation error and returns the first validation error message.
func IsValidationError ¶
IsValidationError checks to see if error is of type validator.ValidationErrors.
func ValidateCountryCode ¶
ValidateCountryCode validates a country code
func ValidateCurrencyCode ¶
ValidateCurrencyCode validates that a given currency code follows ISO 4217 code
func ValidateEmail ¶
ValidateEmail validates an email address returning an error if invalid
func ValidatePhoneNumber ¶
ValidatePhoneNumber validates the provided phone number.
func ValidateUrl ¶
ValidateUrl checks if the provided URL is a valid URL
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.