constraint

package
v0.4.3-final-apache Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// math.MaxInt as a big.Float
	MaxInt = new(big.Float).SetInt64(math.MaxInt)
	// math.MaxInt as a cty number
	MaxIntVal = cty.NumberVal(MaxInt)
	// math.MinInt as a big.Float
	MinInt = new(big.Float).SetInt64(math.MinInt)
	// math.MinInt as a cty number
	MinIntVal = cty.NumberVal(MinInt)
	// math.MaxInt64 as a big.Float
	MaxInt64 = new(big.Float).SetInt64(math.MaxInt64)
	// math.MaxInt64 as a cty number
	MaxInt64Val = cty.NumberVal(MaxInt64)
	// math.MinInt64 as a big.Float
	MinInt64 = new(big.Float).SetInt64(math.MinInt64)
	// math.MinInt64 as a cty number
	MinInt64Val = cty.NumberVal(MinInt64)
)

Functions

This section is empty.

Types

type Constraints

type Constraints uint32
const (
	// Attribute can't be left out (but can be null, empty, etc.)
	Required Constraints = (1 << iota)
	// Attribute can't be null
	NonNull
	// Attribute can't be an empty collection or an empty string
	NonEmpty
	// If an attribute is a string - preprocess it with strings.TrimSpace
	TrimSpace
	// Attribute must be a whole integer number
	Integer
)
const (
	// Attribute will be trimmed and later checked to be non-empty
	// If attribute is not a string - trim operation does nothing
	TrimmedNonEmpty Constraints = TrimSpace | NonEmpty

	// Attribute is not required, but (if specified) must be non-null, non-empty, strings are trimmed
	Meaningful Constraints = NonNull | TrimmedNonEmpty

	// Attribute is required, non-null, non-empty, strings are trimmed
	RequiredMeaningful Constraints = Required | Meaningful

	// Attribute is required and non-null
	RequiredNonNull Constraints = Required | NonNull
)

func (Constraints) Is

func (c Constraints) Is(test Constraints) bool

type OneOf

type OneOf []cty.Value

func (OneOf) IsEmpty

func (o OneOf) IsEmpty() bool

func (OneOf) String

func (o OneOf) String() string

func (OneOf) Validate

func (o OneOf) Validate(val cty.Value) (valid bool)

Jump to

Keyboard shortcuts

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