stringvalidator

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2022 License: MPL-2.0 Imports: 6 Imported by: 453

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:

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL