Decodable structs are structs that can tell their hcl2 ObjectSpec; this config spec will be passed to hcldec.Decode and the result will be a cty.Value. This Value can then be applied on the said struct.
| 13 | // config spec will be passed to hcldec.Decode and the result will be a |
| 14 | // cty.Value. This Value can then be applied on the said struct. |
| 15 | type Decodable interface { |
| 16 | ConfigSpec() hcldec.ObjectSpec |
| 17 | } |
| 18 | |
| 19 | func decodeHCL2Spec(body hcl.Body, ectx *hcl.EvalContext, dec Decodable) (cty.Value, hcl.Diagnostics) { |
| 20 | return hcldec.Decode(body, dec.ConfigSpec(), ectx) |
no outgoing calls
no test coverage detected
searching dependent graphs…