validator

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 10 Imported by: 71

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-z0-9]{3,10}$`), "project_key must be 3 - 10 lowercase alphanumeric characters"),
)

Functions

func 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 Cron

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

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 StringIsNotEmpty

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

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

Types

This section is empty.