validators

package
v0.0.0-...-34ec42c Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package validators contain helper functions for validation of fields and values

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValidationErrMsg

func GetValidationErrMsg(s any, err error) (errMsg string)

GetValidationErrMsg checks to see if the provided err is a validation error and returns the first validation error message.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError checks to see if error is of type validator.ValidationErrors.

func ValidateCountryCode

func ValidateCountryCode(country string) error

ValidateCountryCode validates a country code

func ValidateCurrencyCode

func ValidateCurrencyCode(code string) error

ValidateCurrencyCode validates that a given currency code follows ISO 4217 code

func ValidateEmail

func ValidateEmail(email string) error

ValidateEmail validates an email address returning an error if invalid

func ValidatePhoneNumber

func ValidatePhoneNumber(phoneNumber string) error

ValidatePhoneNumber validates the provided phone number.

func ValidateUrl

func ValidateUrl(url string) error

ValidateUrl checks if the provided URL is a valid URL

Types

This section is empty.

Jump to

Keyboard shortcuts

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