Documentation
¶
Index ¶
- func LengthAtLeast(min int) validator.String
- func LengthAtMost(max int) validator.String
- func LengthBetween(min, max int) validator.String
- func NoneOf(values ...string) validator.String
- func OneOf(values ...string) validator.String
- func RegexMatches(pattern string) validator.String
- func RegexMatchesCI(pattern string) validator.String
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LengthAtLeast ¶
LengthAtLeast checks that the String length is at least the given minimum. If not, it emits a warning diagnostic.
func LengthAtMost ¶
LengthAtMost checks that the String length is at most the given maximum. If not, it emits a warning diagnostic.
func LengthBetween ¶
LengthBetween checks that the String length is within the given inclusive bounds. If not, it emits a warning diagnostic.
func NoneOf ¶
NoneOf checks that the String held in the attribute is none of the given values. If it matches any, it emits a warning diagnostic.
func OneOf ¶
OneOf checks that the String held in the attribute is one of the given values. If not, it emits a warning diagnostic.
func RegexMatches ¶
RegexMatches checks that the String value matches the given regular expression pattern (case-sensitive). If it does not, it emits a warning diagnostic. The pattern must be a valid Go regular expression.
func RegexMatchesCI ¶
RegexMatchesCI is a convenience wrapper around RegexMatches that enforces case-insensitive matching by prefixing the pattern with the (?i) flag.
Types ¶
This section is empty.