Documentation
¶
Index ¶
- func ConflictsIfMatchesPathValue(targetValue basetypes.StringValue, expressions ...path.Expression) validator.String
- func IsB64ContentType(verifyContentTypes ...string) validator.String
- func IsBase64Encoded() validator.String
- func IsRequiredIfMatchesPathValue(targetValue basetypes.StringValue, expressions ...path.Expression) validator.String
- func IsRequiredIfRegexMatchesPathValue(regexp *regexp.Regexp, message string, expressions ...path.Expression) validator.String
- func NotNull() validator.String
- func RegexMatchesPathValue(regexp *regexp.Regexp, message string, expressions ...path.Expression) validator.String
- func ShouldBeDefinedValueIfPathMatchesValue(attributeValue basetypes.StringValue, targetPathValue basetypes.StringValue, ...) validator.String
- func ShouldNotContain(values ...string) validator.String
- type StringNotNullValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConflictsIfMatchesPathValue ¶ added in v0.17.0
func ConflictsIfMatchesPathValue(targetValue basetypes.StringValue, expressions ...path.Expression) validator.String
func IsB64ContentType ¶ added in v1.0.0
IsB64ContentType checks that a set of path.Expression, including the attribute the validator is applied to, is a valid base64 encoded string that is one of the specified content types.
Relative path.Expression will be resolved using the attribute being validated.
func IsBase64Encoded ¶
IsBase64Encoded checks if a string is base64 encdoed.
If the string contains a Content-Type prefex, the prefix is ignored and the subsequent substring is evaluated.
func IsRequiredIfMatchesPathValue ¶
func IsRequiredIfMatchesPathValue(targetValue basetypes.StringValue, expressions ...path.Expression) validator.String
IsRequiredIfMatchesPathValue validates if the provided string value equals the value at the provided path expression(s). If matched, the current arguemnt is required.
If a list of expressions is provided, all expressions are checked until a match is found, or the list of expressions is exhausted.
func IsRequiredIfRegexMatchesPathValue ¶
func IsRequiredIfRegexMatchesPathValue(regexp *regexp.Regexp, message string, expressions ...path.Expression) validator.String
IsRequiredIfRegexMatchesPathValue validates if the provided regex matches the value at the provided path expression(s). If matched, the current argument is required.
If a list of expressions is provided, all expressions are checked until a match is found, or the list of expressions is exhausted.
func NotNull ¶ added in v1.15.1
NotNull returns an validator which ensures that the string attribute is configured. Most attributes should set Required: true instead, however in certain scenarios, such as a computed nested attribute, all underlying attributes must also be computed for planning to not show unexpected differences.
func RegexMatchesPathValue ¶
func RegexMatchesPathValue(regexp *regexp.Regexp, message string, expressions ...path.Expression) validator.String
RegexMatchesPathValue validates if the provided regex matches the value at the provided path expression(s). If a list of expressions is provided, all expressions are checked until a match is found, or the list of expressions is exhausted.
func ShouldBeDefinedValueIfPathMatchesValue ¶ added in v0.17.0
func ShouldBeDefinedValueIfPathMatchesValue(attributeValue basetypes.StringValue, targetPathValue basetypes.StringValue, expressions ...path.Expression) validator.String
func ShouldNotContain ¶ added in v1.0.0
ShouldNotContain checks that the String held in the attribute is none of the given `values`.
Types ¶
type StringNotNullValidator ¶ added in v1.15.1
type StringNotNullValidator struct{}
StringNotNullValidator validates that an attribute is not null. Most attributes should set Required: true instead, however in certain scenarios, such as a computed nested attribute, all underlying attributes must also be computed for planning to not show unexpected differences.
func (StringNotNullValidator) Description ¶ added in v1.15.1
func (v StringNotNullValidator) Description(_ context.Context) string
func (StringNotNullValidator) MarkdownDescription ¶ added in v1.15.1
func (v StringNotNullValidator) MarkdownDescription(ctx context.Context) string
func (StringNotNullValidator) ValidateString ¶ added in v1.15.1
func (v StringNotNullValidator) ValidateString(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse)