variables

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertCtyToInterface

func ConvertCtyToInterface(val cty.Value) (any, error)

Types

type ID

type ID string

func (ID) String

func (p ID) String() string

type Override

type Override struct {
	Name  ID
	Path  pack.ID
	Type  cty.Type
	Value cty.Value
	Range hcl.Range
}

func (*Override) Equal

func (o *Override) Equal(a *Override) bool

type Overrides

type Overrides map[pack.ID][]*Override

type PackIDKeyedVarMap

type PackIDKeyedVarMap map[pack.ID][]*Variable

type Variable

type Variable struct {

	// Name is the variable label. This is used to identify variables being
	// overridden and during templating.
	Name ID

	// Description is an optional field which provides additional context to
	// users identifying what the variable is used for.
	Description string

	// Default is an optional field which provides a default value to be used
	// in the absence of a user-provided value. It is only in this struct for
	// documentation purposes
	Default cty.Value

	// Type represents the concrete cty type of this variable. If the type is
	// unable to be parsed into a cty type, it is invalid.
	Type cty.Type

	// Value stores the variable value and is used when converting the cty type
	// value into a Go type value.
	Value cty.Value

	// DeclRange is the position marker of the variable within the file it was
	// read from. This is used for diagnostics.
	DeclRange hcl.Range
	// contains filtered or unexported fields
}

Variable encapsulates a single variable as defined within a block according to variableFileSchema and variableBlockSchema.

func (*Variable) AsOverrideString

func (v *Variable) AsOverrideString(pID pack.ID) string

func (*Variable) Equal

func (v *Variable) Equal(ivp *Variable) bool

func (*Variable) Merge

func (v *Variable) Merge(in *Variable) hcl.Diagnostics

func (*Variable) SetDefault

func (v *Variable) SetDefault(d cty.Value)

func (*Variable) SetDescription

func (v *Variable) SetDescription(d string)

func (*Variable) SetType

func (v *Variable) SetType(t cty.Type)

Jump to

Keyboard shortcuts

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