Documentation
¶
Overview ¶
Package is provides format validation rules for common string patterns.
Each function returns a value satisfying edict.Rule and edict.Coder. Use with Apply():
v.Field("email").Apply(is.Email())
v.Field("site").Apply(is.URL())
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rule ¶
Rule is the interface satisfied by all format validators in this package. It matches edict.Rule via structural typing.
func Alpha ¶
func Alpha() Rule
Alpha returns a Rule that validates the value contains only ASCII letters.
func AlphaNumeric ¶
func AlphaNumeric() Rule
AlphaNumeric returns a Rule that validates the value contains only ASCII letters and digits.
func HexColor ¶
func HexColor() Rule
HexColor returns a Rule that validates hex color format (#RGB or #RRGGBB).
func Numeric ¶
func Numeric() Rule
Numeric returns a Rule that validates the value contains only ASCII digits.
func Semver ¶
func Semver() Rule
Semver returns a Rule that validates semantic versioning format (X.Y.Z with optional v prefix).