Documentation ¶
Index ¶
- Constants
- func BaseValidator(validationRule string, input string) bool
- func IsCodeChallenge(str string) bool
- func IsContainWhitespace(str string) bool
- func IsCountry(str string) bool
- func IsDate(str string) bool
- func IsDateTime(str string) bool
- func IsDisplayName(str string) bool
- func IsEmail(str string) bool
- func IsIn(str string, params ...string) bool
- func IsJWT(str string) bool
- func IsLanguage(str string) bool
- func IsLowerCase(str string) bool
- func IsNamespace(input string) bool
- func IsNotContainWhitespace(str string) bool
- func IsNumeric(str string) bool
- func IsPassword(str string) bool
- func IsPath(str string) bool
- func IsPermissionResource(str string) bool
- func IsPermissionResourceWithUUID(str string) bool
- func IsPersonName(str string) bool
- func IsTag(str string) bool
- func IsTopic(str string) bool
- func IsURI(str string) bool
- func IsURL(str string) bool
- func IsUUID4WithoutHyphens(str string) bool
- func StringLength(input string, min int, max int) bool
- func ValidateStruct(s interface{}) (bool, error)
Constants ¶
View Source
const ( UUID4WithoutHyphenPattern = "^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$" LanguagePattern = "^[a-zA-Z]+([-]{1}[a-zA-Z]+)*$" TagPattern = "^[a-zA-Z]+([_:-]{1}[a-zA-Z]+)*$" TopicPattern = "^[A-Z]+([_]{1}[A-Z]+)*$" DisplayNamePattern = "^[a-zA-Z0-9]+(([',. -][a-zA-Z0-9])?[a-zA-Z0-9]*)*$" PersonNamePattern = "^[a-zA-Z]+(([',. -][a-zA-Z])?[a-zA-Z]*)*$" OWASPEmailPattern = `^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,15}$` ResourcePermissionPattern = `^[A-Z]+([:]{1}([A-Z]+|(({[a-zA-Z]+})|[a-zA-Z0-9]+|\*)))*$` ResourcePermissionPatternWithUUID = `^[A-Z]+([:]{1}([A-Z]+|(({[a-zA-Z0-9-]+})|[a-zA-Z0-9]+|\*)))*$` OWASPURLPattern = `` /* 136-byte string literal not displayed */ ContainWhitespacePattern = `\s` JWTPattern = `^([A-Za-z0-9\-_~+\/]+[=]{0,2})\.([A-Za-z0-9\-_~+\/]+[=]{0,2})(?:\.([A-Za-z0-9\-_~+\/]+[=]{0,2}))?$` PathPattern = `^(\/[a-zA-Z0-9]+)+$` CodeChallengePattern = `^[a-zA-Z0-9-._~]*$` ISO8601TimeFormat = "2006-01-02" OWASPComplexPasswordPattern = `` /* 224-byte string literal not displayed */ NamespacePattern = `^[a-zA-Z0-9]{1,256}(\-[a-zA-Z0-9]{1,256})?$` )
Variables ¶
This section is empty.
Functions ¶
func BaseValidator ¶ added in v0.0.3
BaseValidator is used to extend validate function in GoValidator
func IsCodeChallenge ¶ added in v0.0.3
func IsContainWhitespace ¶ added in v0.0.3
func IsDateTime ¶ added in v0.0.3
func IsDisplayName ¶
func IsLanguage ¶
func IsLowerCase ¶
func IsNamespace ¶ added in v0.1.0
func IsNotContainWhitespace ¶ added in v0.0.3
func IsPassword ¶
func IsPermissionResource ¶
func IsPermissionResourceWithUUID ¶ added in v0.0.5
func IsPersonName ¶ added in v0.0.3
func IsUUID4WithoutHyphens ¶
func ValidateStruct ¶
ValidateStruct is used to check the Struct based on the rule of each field
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.