validator

package module
v0.0.0-...-b35954a Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

Validator

Validator base of https://github.com/go-playground/validator

Validations

String
Tag Description
startwithalpha Field Must be start with Alpha

Documentation

Index

Constants

View Source
const (
	UsernameRegexString = "^[a-z0-9_@\\.]+$"
)

Variables

View Source
var (
	AlphaRegex                 = regexp.MustCompile(alphaRegexString)
	AlphaNumericRegex          = regexp.MustCompile(alphaNumericRegexString)
	AlphaUnicodeRegex          = regexp.MustCompile(alphaUnicodeRegexString)
	AlphaUnicodeNumericRegex   = regexp.MustCompile(alphaUnicodeNumericRegexString)
	NumericRegex               = regexp.MustCompile(numericRegexString)
	NumberRegex                = regexp.MustCompile(numberRegexString)
	HexadecimalRegex           = regexp.MustCompile(hexadecimalRegexString)
	HexColorRegex              = regexp.MustCompile(hexColorRegexString)
	RgbRegex                   = regexp.MustCompile(rgbRegexString)
	RgbaRegex                  = regexp.MustCompile(rgbaRegexString)
	HslRegex                   = regexp.MustCompile(hslRegexString)
	HslaRegex                  = regexp.MustCompile(hslaRegexString)
	E164Regex                  = regexp.MustCompile(e164RegexString)
	EmailRegex                 = regexp.MustCompile(emailRegexString)
	Base64Regex                = regexp.MustCompile(base64RegexString)
	Base64URLRegex             = regexp.MustCompile(base64URLRegexString)
	ISBN10Regex                = regexp.MustCompile(iSBN10RegexString)
	ISBN13Regex                = regexp.MustCompile(iSBN13RegexString)
	UUID3Regex                 = regexp.MustCompile(uUID3RegexString)
	UUID4Regex                 = regexp.MustCompile(uUID4RegexString)
	UUID5Regex                 = regexp.MustCompile(uUID5RegexString)
	UUIDRegex                  = regexp.MustCompile(uUIDRegexString)
	UUID3RFC4122Regex          = regexp.MustCompile(uUID3RFC4122RegexString)
	UUID4RFC4122Regex          = regexp.MustCompile(uUID4RFC4122RegexString)
	UUID5RFC4122Regex          = regexp.MustCompile(uUID5RFC4122RegexString)
	UUIDRFC4122Regex           = regexp.MustCompile(uUIDRFC4122RegexString)
	ULIDRegex                  = regexp.MustCompile(uLIDRegexString)
	Md4Regex                   = regexp.MustCompile(md4RegexString)
	Md5Regex                   = regexp.MustCompile(md5RegexString)
	Sha256Regex                = regexp.MustCompile(sha256RegexString)
	Sha384Regex                = regexp.MustCompile(sha384RegexString)
	Sha512Regex                = regexp.MustCompile(sha512RegexString)
	Ripemd128Regex             = regexp.MustCompile(ripemd128RegexString)
	Ripemd160Regex             = regexp.MustCompile(ripemd160RegexString)
	Tiger128Regex              = regexp.MustCompile(tiger128RegexString)
	Tiger160Regex              = regexp.MustCompile(tiger160RegexString)
	Tiger192Regex              = regexp.MustCompile(tiger192RegexString)
	ASCIIRegex                 = regexp.MustCompile(aSCIIRegexString)
	PrintableASCIIRegex        = regexp.MustCompile(printableASCIIRegexString)
	MultibyteRegex             = regexp.MustCompile(multibyteRegexString)
	DataURIRegex               = regexp.MustCompile(dataURIRegexString)
	LatitudeRegex              = regexp.MustCompile(latitudeRegexString)
	LongitudeRegex             = regexp.MustCompile(longitudeRegexString)
	SSNRegex                   = regexp.MustCompile(sSNRegexString)
	HostnameRegexRFC952        = regexp.MustCompile(hostnameRegexStringRFC952)
	HostnameRegexRFC1123       = regexp.MustCompile(hostnameRegexStringRFC1123)
	FqdnRegexRFC1123           = regexp.MustCompile(fqdnRegexStringRFC1123)
	BtcAddressRegex            = regexp.MustCompile(btcAddressRegexString)
	BtcUpperAddressRegexBech32 = regexp.MustCompile(btcAddressUpperRegexStringBech32)
	BtcLowerAddressRegexBech32 = regexp.MustCompile(btcAddressLowerRegexStringBech32)
	EthAddressRegex            = regexp.MustCompile(ethAddressRegexString)
	EthAddressRegexUpper       = regexp.MustCompile(ethAddressUpperRegexString)
	EthAddressRegexLower       = regexp.MustCompile(ethAddressLowerRegexString)
	URLEncodedRegex            = regexp.MustCompile(uRLEncodedRegexString)
	HTMLEncodedRegex           = regexp.MustCompile(hTMLEncodedRegexString)
	HTMLRegex                  = regexp.MustCompile(hTMLRegexString)
	JWTRegex                   = regexp.MustCompile(jWTRegexString)
	SplitParamsRegex           = regexp.MustCompile(splitParamsRegexString)
	BicRegex                   = regexp.MustCompile(bicRegexString)
	SemverRegex                = regexp.MustCompile(semverRegexString)
	DnsRegexRFC1035Label       = regexp.MustCompile(dnsRegexStringRFC1035Label)
	UsernameRegex              = regexp.MustCompile(UsernameRegexString)
)
View Source
var Validators = map[string]validator.Func{
	"startwithalpha": IsStartWithAlpha,
}

Functions

func IsStartWithAlpha

func IsStartWithAlpha(fl validator.FieldLevel) bool

IsStartWithAlpha Is start with alpha.

func RegisterValidators

func RegisterValidators(validate *validator.Validate) error

func StartWithAlpha

func StartWithAlpha(s string) error

Types

This section is empty.

Directories

Path Synopsis
translations
en
zh

Jump to

Keyboard shortcuts

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