schemavalidator

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package schemavalidator provides validators to express relationships between multiple attributes within the schema of a resource, data source, or provider. For example, checking that an attribute is present when another is present, or vice-versa.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlsoRequires

func AlsoRequires(attributePaths ...path.Expression) tfsdk.AttributeValidator

AlsoRequires checks that a set of path.Expression has a non-null value, if the current attribute also has a non-null value.

This implements the validation logic declaratively within the tfsdk.Schema.

Relative path.Expression will be resolved against the validated attribute.

func AtLeastOneOf

func AtLeastOneOf(attributePaths ...path.Expression) tfsdk.AttributeValidator

AtLeastOneOf checks that of a set of path.Expression, including the attribute it's applied to, at least one attribute out of all specified is has a non-null value.

This implements the validation logic declaratively within the tfsdk.Schema.

Any relative path.Expression will be resolved against the attribute with this validator.

func ConflictsWith

func ConflictsWith(attributePaths ...path.Expression) tfsdk.AttributeValidator

ConflictsWith checks that a set of path.Expression, including the attribute it's applied to, do not have a value simultaneously.

This implements the validation logic declaratively within the tfsdk.Schema.

Relative path.Expression will be resolved against the validated attribute.

func ExactlyOneOf

func ExactlyOneOf(attributePaths ...path.Expression) tfsdk.AttributeValidator

ExactlyOneOf checks that of a set of path.Expression, including the attribute it's applied to, one and only one attribute out of all specified has a value. It will also cause a validation error if none are specified.

This implements the validation logic declaratively within the tfsdk.Schema.

Relative path.Expression will be resolved against the validated attribute.

Types

This section is empty.

Jump to

Keyboard shortcuts

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