Documentation
¶
Index ¶
- func ConvertCtyToInterface(val cty.Value) (any, error)
- func IndentTypeString(typeStr string, indent int) string
- func PrintDefault(v cty.Value) string
- func PrintType(t cty.Type) string
- type ID
- type Override
- type Overrides
- type PackIDKeyedVarMap
- type Variable
- func (v *Variable) AsOverrideString(pID pack.ID) string
- func (v *Variable) Equal(ivp *Variable) bool
- func (v *Variable) Merge(in *Variable) hcl.Diagnostics
- func (v *Variable) SetDefault(d cty.Value)
- func (v *Variable) SetDescription(d string)
- func (v *Variable) SetType(t cty.Type)
- func (v *Variable) SetTypeDefaults(t *typeexpr.Defaults)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndentTypeString ¶ added in v0.4.2
IndentTypeString indents all newlines in a type string by the given number of spaces. This is used to properly format multi-line object types in the output.
func PrintDefault ¶ added in v0.4.2
PrintDefault recursively prints out a cty.Value specification in a format that matched the way it is defined. This allows us to not have to capture or replicate the original presentation. However, could this be captured in parsing?
Types ¶
type PackIDKeyedVarMap ¶
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
// ConstraintType represents the type constraint for this variable and is
// used for decoding and type validation. This may contain nested
// ObjectWithOptionalAttrs types.
ConstraintType cty.Type
TypeDefaults *typeexpr.Defaults
// 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) SetDefault ¶
func (*Variable) SetDescription ¶
func (*Variable) SetTypeDefaults ¶ added in v0.4.2
Click to show internal directories.
Click to hide internal directories.