validate

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayLenAtLeast

func ArrayLenAtLeast(minItems int) tfsdk.AttributeValidator

ArrayLenAtLeast returns a new array length at least validator.

func ArrayLenBetween

func ArrayLenBetween(minItems, maxItems int) tfsdk.AttributeValidator

ArrayLenBetween returns a new array length between validator.

func FloatAtLeast

func FloatAtLeast(min float64) tfsdk.AttributeValidator

FloatAtLeast returns a new float value at least validator.

func FloatBetween

func FloatBetween(min, max float64) tfsdk.AttributeValidator

FloatBetween returns a new float value between validator.

func IntAtLeast

func IntAtLeast(min int) tfsdk.AttributeValidator

IntAtLeast returns a new integer value at least validator.

func IntBetween

func IntBetween(min, max int) tfsdk.AttributeValidator

IntBetween returns a new integer value between validator.

func IntInSlice

func IntInSlice(valid []int) tfsdk.AttributeValidator

IntInSlice returns a new integer in slicde validator.

func IsRFC3339Time

func IsRFC3339Time() tfsdk.AttributeValidator

IsRFC3339Time returns a new string RFC33349Time validator.

func RequiredAttributes

func RequiredAttributes(fs ...RequiredAttributesFunc) tfsdk.AttributeValidator

AttributeRequired returns a new required Attributes validator.

func ResourceConfigRequiredAttributes

func ResourceConfigRequiredAttributes(fs ...RequiredAttributesFunc) tfsdk.ResourceConfigValidator

ResourceConfigRequiredAttributes returns a new resource schema-level required Attributes validator.

func StringInSlice

func StringInSlice(valid []string) tfsdk.AttributeValidator

StringLenAtLeast returns a new string in slice validator.

func StringLenAtLeast

func StringLenAtLeast(minLength int) tfsdk.AttributeValidator

StringLenAtLeast returns a new string length at least validator.

func StringLenBetween

func StringLenBetween(minLength, maxLength int) tfsdk.AttributeValidator

StringLenBetween returns a new string length between validator.

func UniqueItems

func UniqueItems() tfsdk.AttributeValidator

UniqueItems returns a new unique items validator.

Types

type RequiredAttributesFunc

type RequiredAttributesFunc func(names []string) tfdiag.Diagnostics

func AllOfRequired

AllOfRequired returns a RequiredAttributesFunc that validates that all of the specified validators pass. "To validate against allOf, the given data must be valid against all of the given subschemas."

func AnyOfRequired

AnyOfRequired returns a RequiredAttributesFunc that validates that any of the specified validators pass. "To validate against anyOf, the given data must be valid against any (one or more) of the given subschemas."

func OneOfRequired

OneOfRequired returns a RequiredAttributesFunc that validates that exactly one of of the specified validators pass. "To validate against oneOf, the given data must be valid against exactly one of the given subschemas."

func Required

func Required(required ...string) RequiredAttributesFunc

Required returns a RequiredAttributesFunc that validates that all required attributes are specfied.

Jump to

Keyboard shortcuts

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