varcheck

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package varcheck provides the structs used to compare terraform variable declarations with a set of constraints.

Package varcheck is the entry point of the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TypeConstraintWithDefaults

type TypeConstraintWithDefaults struct {
	Type    cty.Type           // The type constraint, this will always have a value
	Default *typeexpr.Defaults // The default value, this will be nil if no defaults are used in the type constraint
}

TypeConstraintWithDefaults represents a type constraint and default value for a Terraform variable.

func NewTypeConstraintWithDefaultsFromBytes

func NewTypeConstraintWithDefaultsFromBytes(b []byte) (TypeConstraintWithDefaults, hcl.Diagnostics)

NewTypeConstraintWithDefaultsFromString creates a new TypeConstraintWithDefaults from a byte slice.

func NewTypeConstraintWithDefaultsFromExp

func NewTypeConstraintWithDefaultsFromExp(exp hcl.Expression) (TypeConstraintWithDefaults, hcl.Diagnostics)

NewVariableTypeFromExpression creates a new TypeConstraintWithDefaults from a given hcl.Expression.

type VarCheck

type VarCheck struct {
	Default                cty.Value                  // Default value for the interface as a cty.Value
	Nullable               bool                       // Whether the variable should be nullable.
	TypeConstraintWithDefs TypeConstraintWithDefaults // Strong type representing the type as well as default values. Use NewTypeConstraintWithDefaultsFromExp or NewTypeConstraintWithDefaultsFromBytes to create.
}

VarCheck is the struct that represents a variable check.

func NewVarCheck

func NewVarCheck(ty TypeConstraintWithDefaults, def cty.Value, nullable bool) VarCheck

NewVarCheck creates a new VarCheck struct.

Jump to

Keyboard shortcuts

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