validator

package
v1.25.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 53

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommaSeperatedList = validation.ToDiagFunc(
	validation.StringMatch(regexp.MustCompile(`.+(?:,.+)*`), "must be comma separated string"),
)
View Source
var LicenseType = validation.ToDiagFunc(validation.StringInSlice(validLicenseTypes, false))
View Source
var ProjectKey = validation.ToDiagFunc(
	validation.StringMatch(regexp.MustCompile(`^[a-z][a-z0-9\-]{1,31}$`), "project_key must be 2 - 32 lowercase alphanumeric and hyphen characters"),
)

Functions

func All

All Updated version of the Terraform's original validation func: https://github.com/hashicorp/terraform-plugin-sdk/blob/main/helper/validation/meta.go#L32

All returns a SchemaValidateFunc which tests if the provided value passes all provided SchemaValidateFunc

func CheckImportState added in v1.10.0

func CheckImportState(resourceId string, idAttribute string) func(states []*terraform.InstanceState) error

CheckImportState is used in ImportStateCheck if ImportState is set to `true`. IdAttribute is the field used in d.SetId() in Create function to set a resource ID.

func Cron

func Cron(value interface{}, _ cty.Path) diag.Diagnostics

func CronLength added in v1.9.0

func CronLength(value interface{}, _ cty.Path) diag.Diagnostics

func IntAtLeast added in v0.3.0

func IntAtLeast(min int) schema.SchemaValidateDiagFunc

IntAtLeast Updated version of the Terraform's original validation func: https://github.com/hashicorp/terraform-plugin-sdk/blob/5adf5f1c4bf0aee7bb31d51cd7f016e81a39e3e5/helper/validation/int.go#L31

IntAtLeast returns a SchemaValidateFunc which tests if the provided value is of type int and is at least min (inclusive)

func IsEmail

func IsEmail(address interface{}, _ cty.Path) diag.Diagnostics

func LdapDn

func LdapDn(value interface{}, _ cty.Path) diag.Diagnostics

func LdapFilter

func LdapFilter(value interface{}, _ cty.Path) diag.Diagnostics

func LowerCase

func LowerCase(value interface{}, key cty.Path) diag.Diagnostics

func StringInSlice added in v0.3.0

func StringInSlice(ignoreCase bool, valid ...string) schema.SchemaValidateDiagFunc

Updated version of the Terraform's original validation func: https://github.com/hashicorp/terraform-plugin-sdk/blob/5adf5f1c4bf0aee7bb31d51cd7f016e81a39e3e5/helper/validation/strings.go#L132

StringInSlice returns a SchemaValidateFunc which tests if the provided value is of type string and matches the value of an element in the valid slice will test with in lower case if ignoreCase is true

func StringIsNotEmpty

func StringIsNotEmpty(i interface{}, p cty.Path) diag.Diagnostics

StringIsNotEmpty Updated version of the Terraform's original validation func: https://github.com/hashicorp/terraform-plugin-sdk/blob/main/helper/validation/strings.go#L14

func StringIsNotURL added in v0.6.0

func StringIsNotURL(value interface{}, p cty.Path) diag.Diagnostics

Types

This section is empty.

Directories

Path Synopsis
fw

Jump to

Keyboard shortcuts

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