Documentation ¶
Index ¶
- func EmptyBody() hcl.Body
- func FilterExcludeBody(body hcl.Body, schema *hcl.BodySchema) hcl.Body
- func FilterIncludeBody(body hcl.Body, schema *hcl.BodySchema) hcl.Body
- func ImpliedType(gv interface{}) (cty.Type, error)
- func MergeBodies(bodies []hcl.Body) hcl.Body
- func MergeFiles(files []*hcl.File) hcl.Body
- func Stdlib() map[string]function.Function
- func ToCtyValue(val any, ty cty.Type) (cty.Value, error)
- func UnwrapCtyValue(in cty.Value) cty.Value
- type FromCtyValueConverter
- type Opt
- type ParseMeta
- type ToCtyValueConverter
- type Variable
- type WithEvalContexts
- type WithGetName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmptyBody ¶ added in v0.12.0
func EmptyBody() hcl.Body
EmptyBody returns a body with no content. This body can be used as a placeholder when a body is required but no body content is available.
func FilterExcludeBody ¶ added in v0.10.0
func FilterExcludeBody(body hcl.Body, schema *hcl.BodySchema) hcl.Body
func FilterIncludeBody ¶ added in v0.10.0
func FilterIncludeBody(body hcl.Body, schema *hcl.BodySchema) hcl.Body
func ImpliedType ¶ added in v0.19.0
ImpliedType takes an arbitrary Go value (as an interface{}) and attempts to find a suitable cty.Type instance that could be used for a conversion with ToCtyValue.
This allows -- for simple situations at least -- types to be defined just once in Go and the cty types derived from the Go types, but in the process it makes some assumptions that may be undesirable so applications are encouraged to build their cty types directly if exacting control is required.
Not all Go types can be represented as cty types, so an error may be returned which is usually considered to be a bug in the calling program. In particular, ImpliedType will never use capsule types in its returned type, because it cannot know the capsule types supported by the calling program.
func MergeBodies ¶ added in v0.12.0
func MergeBodies(bodies []hcl.Body) hcl.Body
MergeBodies is like MergeFiles except it deals directly with bodies, rather than with entire files.
func MergeFiles ¶ added in v0.12.0
func MergeFiles(files []*hcl.File) hcl.Body
MergeFiles combines the given files to produce a single body that contains configuration from all of the given files.
The ordering of the given files decides the order in which contained elements will be returned. If any top-level attributes are defined with the same name across multiple files, a diagnostic will be produced from the Content and PartialContent methods describing this error in a user-friendly way.
Types ¶
type FromCtyValueConverter ¶ added in v0.20.0
type ToCtyValueConverter ¶ added in v0.20.0
type WithEvalContexts ¶ added in v0.11.0
type WithEvalContexts interface {
GetEvalContexts(base *hcl.EvalContext, block *hcl.Block, loadDeps func(hcl.Expression) hcl.Diagnostics) ([]*hcl.EvalContext, error)
}