validationutils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package validationutils provides essential validation utilities. Because users will always find a way to break your input validation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InRange

func InRange(value, minVal, maxVal float64) bool

InRange checks if number is within range.

func IsAlpha

func IsAlpha(s string) bool

IsAlpha checks if string contains only letters.

func IsColor

func IsColor(color string) bool

IsColor validates if a string is a valid color (hex, rgb, rgba, hsl, hsla).

func IsDate

func IsDate(dateStr string) bool

IsDate validates if a string is in a valid date format (YYYY-MM-DD).

func IsDateTime

func IsDateTime(datetimeStr string) bool

IsDateTime validates if a string is in a valid datetime format (YYYY-MM-DD HH:MM:SS).

func IsEmail

func IsEmail(email string) bool

IsEmail validates email using standard library.

func IsFloat

func IsFloat(s string) bool

IsFloat checks if string is a valid float number.

func IsISBN

func IsISBN(isbn string) bool

IsISBN validates if a string is a valid ISBN (10 or 13 digits).

func IsLatitude

func IsLatitude(lat string) bool

IsLatitude validates if a string is a valid latitude.

func IsLongitude

func IsLongitude(lng string) bool

IsLongitude validates if a string is a valid longitude.

func IsNumeric

func IsNumeric(s string) bool

IsNumeric checks if string contains only digits.

func IsPostalCode

func IsPostalCode(code, country string) bool

IsPostalCode validates if a string is a valid postal code for various countries.

func IsStrongPassword

func IsStrongPassword(password string) bool

IsStrongPassword checks basic password strength. Minimum requirements because apparently "password123" isn't secure

func IsTime

func IsTime(timeStr string) bool

IsTime validates if a string is in a valid time format (HH:MM or HH:MM:SS).

func IsURL

func IsURL(urlStr string) bool

IsURL validates URL using standard library.

func IsZipCode

func IsZipCode(zip string) bool

IsZipCode validates if a string is a valid US ZIP code.

Types

This section is empty.