Documentation
¶
Overview ¶
Package int64validator provides validators for types.Int64 attributes.
Index ¶
- func All(validators ...validator.Int64) validator.Int64
- func AlsoRequires(expressions ...path.Expression) validator.Int64
- func Any(validators ...validator.Int64) validator.Int64
- func AnyWithAllWarnings(validators ...validator.Int64) validator.Int64
- func AtLeast(min int64) validator.Int64
- func AtLeastOneOf(expressions ...path.Expression) validator.Int64
- func AtLeastSumOf(attributesToSumPathExpressions ...path.Expression) validator.Int64
- func AtMost(max int64) validator.Int64
- func AtMostSumOf(attributesToSumPathExpressions ...path.Expression) validator.Int64
- func Between(min, max int64) validator.Int64
- func ConflictsWith(expressions ...path.Expression) validator.Int64
- func EqualToSumOf(attributesToSumPathExpressions ...path.Expression) validator.Int64
- func ExactlyOneOf(expressions ...path.Expression) validator.Int64
- func NoneOf(values ...int64) validator.Int64
- func OneOf(values ...int64) validator.Int64
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶ added in v0.7.0
All returns a validator which ensures that any configured attribute value attribute value validates against all the given validators.
Use of All is only necessary when used in conjunction with Any or AnyWithAllWarnings as the Validators field automatically applies a logical AND.
Example ¶
package main
import (
"github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
)
func main() {
// Used within a Schema method of a DataSource, Provider, or Resource
_ = schema.Schema{
Attributes: map[string]schema.Attribute{
"example_attr": schema.Int64Attribute{
Required: true,
Validators: []validator.Int64{
// Validate this Int64 value must either be:
// - 1.0
// - At least 2.0, but not 3.0
int64validator.Any(
int64validator.OneOf(1.0),
int64validator.All(
int64validator.AtLeast(2.0),
int64validator.NoneOf(3.0),
),
),
},
},
},
}
}
Output: