Documentation
¶
Overview ¶
Package stringvalidator provides validators for types.String attributes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LengthAtLeast ¶
func LengthAtLeast(minLength int) tfsdk.AttributeValidator
LengthAtLeast returns an AttributeValidator which ensures that any configured attribute value:
- Is a string.
- Is of length exclusively greater than the given minimum.
Null (unconfigured) and unknown (known after apply) values are skipped.
func LengthAtMost ¶
func LengthAtMost(maxLength int) tfsdk.AttributeValidator
LengthAtMost returns an AttributeValidator which ensures that any configured attribute value:
- Is a string.
- Is of length exclusively less than the given maximum.
Null (unconfigured) and unknown (known after apply) values are skipped.
func LengthBetween ¶
func LengthBetween(minLength, maxLength int) tfsdk.AttributeValidator
LengthBetween returns an AttributeValidator which ensures that any configured attribute value:
- Is a string.
- Is of length greater than the given minimum and less than the given maximum.
Null (unconfigured) and unknown (known after apply) values are skipped.
func RegexMatches ¶
func RegexMatches(regexp *regexp.Regexp, message string) tfsdk.AttributeValidator
RegexMatches returns an AttributeValidator which ensures that any configured attribute value:
- Is a string.
- Matches the given regular expression https://github.com/google/re2/wiki/Syntax.
Null (unconfigured) and unknown (known after apply) values are skipped. Optionally an error message can be provided to return something friendlier than "value must match regular expression 'regexp'".
Types ¶
This section is empty.