frameworkvalidators

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package frameworkvalidators contains functionality for mapping validations onto specification that uses terraform-plugin-framework-validators.

Currently, the specification requires all schema validations to be written as "custom" validations. Over time, the specification may begin to support "native" validations for very common use cases as specific properties, which would alleviate some of the need of this package.

Index

Constants

View Source
const (
	// CodeImportBasePath is the base code import path for framework validators.
	CodeImportBasePath = "github.com/hashicorp/terraform-plugin-framework-validators"
)
View Source
const (
	// Float64ValidatorPackage is the name of the float64 validation package in
	// the framework validators module.
	Float64ValidatorPackage = "float64validator"
)
View Source
const (
	// Int64ValidatorPackage is the name of the int64 validation package in
	// the framework validators module.
	Int64ValidatorPackage = "int64validator"
)
View Source
const (
	// ListValidatorPackage is the name of the list validation package in
	// the framework validators module.
	ListValidatorPackage = "listvalidator"
)
View Source
const (
	// MapValidatorPackage is the name of the set validation package in
	// the framework validators module.
	MapValidatorPackage = "mapvalidator"
)
View Source
const (
	// SetValidatorPackage is the name of the set validation package in
	// the framework validators module.
	SetValidatorPackage = "setvalidator"
)
View Source
const (
	// StringValidatorPackage is the name of the string validation package in
	// the framework validators module.
	StringValidatorPackage = "stringvalidator"
)

Variables

View Source
var (
	// Float64ValidatorCodeImport is a single allocation of the framework
	// validators module float64validator package import.
	Float64ValidatorCodeImport code.Import = CodeImport(Float64ValidatorPackage)
)
View Source
var (
	// Int64ValidatorCodeImport is a single allocation of the framework
	// validators module int64validator package import.
	Int64ValidatorCodeImport code.Import = CodeImport(Int64ValidatorPackage)
)
View Source
var (
	// ListValidatorCodeImport is a single allocation of the framework
	// validators module listvalidator package import.
	ListValidatorCodeImport code.Import = CodeImport(ListValidatorPackage)
)
View Source
var (
	// MapValidatorCodeImport is a single allocation of the framework
	// validators module mapvalidator package import.
	MapValidatorCodeImport code.Import = CodeImport(MapValidatorPackage)
)
View Source
var (
	// SetValidatorCodeImport is a single allocation of the framework
	// validators module setvalidator package import.
	SetValidatorCodeImport code.Import = CodeImport(SetValidatorPackage)
)
View Source
var (
	// StringValidatorCodeImport is a single allocation of the framework
	// validators module stringvalidator package import.
	StringValidatorCodeImport code.Import = CodeImport(StringValidatorPackage)
)

Functions

func CodeImport

func CodeImport(packagePath string) code.Import

CodeImport returns the framework validators code import for the given path.

func Float64ValidatorOneOf

func Float64ValidatorOneOf(values []float64) *schema.CustomValidator

Float64ValidatorOneOf returns a custom validator mapped to the Float64validator package OneOf function. If the values are nil or empty, nil is returned.

func Int64ValidatorAtLeast

func Int64ValidatorAtLeast(min int64) *schema.CustomValidator

Int64ValidatorAtLeast returns a custom validator mapped to the int64validator package AtLeast function.

func Int64ValidatorAtMost

func Int64ValidatorAtMost(max int64) *schema.CustomValidator

Int64ValidatorAtMost returns a custom validator mapped to the int64validator package AtMost function.

func Int64ValidatorBetween

func Int64ValidatorBetween(min, max int64) *schema.CustomValidator

Int64ValidatorBetween returns a custom validator mapped to the int64validator package Between function.

func Int64ValidatorOneOf

func Int64ValidatorOneOf(values []int64) *schema.CustomValidator

Int64ValidatorOneOf returns a custom validator mapped to the int64validator package OneOf function. If the values are nil or empty, nil is returned.

func ListValidatorSizeAtLeast

func ListValidatorSizeAtLeast(min int64) *schema.CustomValidator

ListValidatorSizeAtLeast returns a custom validator mapped to the listvalidator package SizeAtLeast function.

func ListValidatorSizeAtMost

func ListValidatorSizeAtMost(max int64) *schema.CustomValidator

ListValidatorSizeAtMost returns a custom validator mapped to the listvalidator package SizeAtMost function.

func ListValidatorSizeBetween

func ListValidatorSizeBetween(min, max int64) *schema.CustomValidator

ListValidatorSizeBetween returns a custom validator mapped to the listvalidator package SizeBetween function.

func ListValidatorUniqueValues

func ListValidatorUniqueValues() *schema.CustomValidator

ListValidatorUniqueValues returns a custom validator mapped to the listvalidator package UniqueValues function.

func MapValidatorSizeAtLeast

func MapValidatorSizeAtLeast(min int64) *schema.CustomValidator

MapValidatorSizeAtLeast returns a custom validator mapped to the Mapvalidator package SizeAtLeast function.

func MapValidatorSizeAtMost

func MapValidatorSizeAtMost(max int64) *schema.CustomValidator

MapValidatorSizeAtMost returns a custom validator mapped to the Mapvalidator package SizeAtMost function.

func MapValidatorSizeBetween

func MapValidatorSizeBetween(min, max int64) *schema.CustomValidator

MapValidatorSizeBetween returns a custom validator mapped to the Mapvalidator package SizeBetween function.

func SetValidatorSizeAtLeast

func SetValidatorSizeAtLeast(min int64) *schema.CustomValidator

SetValidatorSizeAtLeast returns a custom validator mapped to the Setvalidator package SizeAtLeast function.

func SetValidatorSizeAtMost

func SetValidatorSizeAtMost(max int64) *schema.CustomValidator

SetValidatorSizeAtMost returns a custom validator mapped to the Setvalidator package SizeAtMost function.

func SetValidatorSizeBetween

func SetValidatorSizeBetween(min, max int64) *schema.CustomValidator

SetValidatorSizeBetween returns a custom validator mapped to the Setvalidator package SizeBetween function.

func StringValidatorLengthAtLeast

func StringValidatorLengthAtLeast(min int64) *schema.CustomValidator

StringValidatorLengthAtLeast returns a custom validator mapped to the stringvalidator package LengthAtLeast function.

func StringValidatorLengthAtMost

func StringValidatorLengthAtMost(max int64) *schema.CustomValidator

StringValidatorLengthAtMost returns a custom validator mapped to the stringvalidator package LengthAtMost function.

func StringValidatorLengthBetween

func StringValidatorLengthBetween(min, max int64) *schema.CustomValidator

StringValidatorLengthBetween returns a custom validator mapped to the stringvalidator package LengthBetween function.

func StringValidatorOneOf

func StringValidatorOneOf(values []string) *schema.CustomValidator

StringValidatorOneOf returns a custom validator mapped to the stringvalidator package OneOf function. If the values are nil or empty, nil is returned.

func StringValidatorRegexMatches

func StringValidatorRegexMatches(pattern, message string) *schema.CustomValidator

StringValidatorRegexMatches returns a custom validator mapped to the stringvalidator package RegexMatches function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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