MCPcopy
hub / github.com/hashicorp/hcl / expandBody

Struct expandBody

ext/dynblock/expand_body.go:15–33  ·  ext/dynblock/expand_body.go::expandBody

expandBody wraps another hcl.Body and expands any "dynamic" blocks found inside whenever Content or PartialContent is called.

Source from the content-addressed store, hash-verified

13// expandBody wraps another hcl.Body and expands any "dynamic" blocks found
14// inside whenever Content or PartialContent is called.
15type expandBody struct {
16 original hcl.Body
17 forEachCtx *hcl.EvalContext
18 iteration *iteration // non-nil if we're nested inside another "dynamic" block
19 valueMarks cty.ValueMarks
20
21 checkForEach []func(cty.Value, hcl.Expression, *hcl.EvalContext) hcl.Diagnostics
22
23 // These are used with PartialContent to produce a "remaining items"
24 // body to return. They are nil on all bodies fresh out of the transformer.
25 //
26 // Note that this is re-implemented here rather than delegating to the
27 // existing support required by the underlying body because we need to
28 // retain access to the entire original body on subsequent decode operations
29 // so we can retain any "dynamic" blocks for types we didn't take consume
30 // on the first pass.
31 hiddenAttrs map[string]struct{}
32 hiddenBlocks map[string]hcl.BlockHeaderSchema
33}
34
35func (b *expandBody) Content(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Diagnostics) {
36 extSchema := b.extendSchema(schema)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected