(body hcl.Body, blockLabels []blockLabel, ctx *hcl.EvalContext, spec Spec, partial bool)
| 9 | ) |
| 10 | |
| 11 | func decode(body hcl.Body, blockLabels []blockLabel, ctx *hcl.EvalContext, spec Spec, partial bool) (cty.Value, hcl.Body, hcl.Diagnostics) { |
| 12 | schema := ImpliedSchema(spec) |
| 13 | |
| 14 | var content *hcl.BodyContent |
| 15 | var diags hcl.Diagnostics |
| 16 | var leftovers hcl.Body |
| 17 | |
| 18 | if partial { |
| 19 | content, leftovers, diags = body.PartialContent(schema) |
| 20 | } else { |
| 21 | content, diags = body.Content(schema) |
| 22 | } |
| 23 | |
| 24 | val, valDiags := spec.decode(content, blockLabels, ctx) |
| 25 | diags = append(diags, valDiags...) |
| 26 | |
| 27 | return val, leftovers, diags |
| 28 | } |
| 29 | |
| 30 | func impliedType(spec Spec) cty.Type { |
| 31 | return spec.impliedType() |
no test coverage detected