Documentation ¶
Index ¶
- func GetStdlibFuncs() map[string]function.Function
- func HclConfigToInterface(t *testing.T, config string) interface{}
- func JsonConfigToInterface(t *testing.T, config string) interface{}
- func ParseHclInterface(val interface{}, spec hcldec.Spec, vars map[string]cty.Value) (cty.Value, hcl.Diagnostics)
- type HCLParser
- type MapStrInt
- type MapStrStr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStdlibFuncs ¶
GetStdlibFuncs returns the set of stdlib functions.
func HclConfigToInterface ¶
func JsonConfigToInterface ¶
func ParseHclInterface ¶
func ParseHclInterface(val interface{}, spec hcldec.Spec, vars map[string]cty.Value) (cty.Value, hcl.Diagnostics)
ParseHclInterface is used to convert an interface value representing a hcl2 body and return the interpolated value. Vars may be nil if there are no variables to interpolate.
Types ¶
type HCLParser ¶
type HCLParser struct {
// contains filtered or unexported fields
}
func NewConfigParser ¶
NewConfigParser return a helper for parsing drivers TaskConfig Parser is an immutable object can be used in multiple tests
func (*HCLParser) ParseHCL ¶
ParseHCL parses the hcl config string and decode it into the `out` parameter. out parameter should be a golang reference to a driver specific TaskConfig reference. The function terminates and reports errors if any is found during conversion.
Sample invocation would be ¶
``` var tc *TaskConfig hclutils.NewConfigParser(spec).ParseHCL(t, configString, &tc) ```
func (*HCLParser) ParseJson ¶
ParseJson parses the json config string and decode it into the `out` parameter. out parameter should be a golang reference to a driver specific TaskConfig reference. The function terminates and reports errors if any is found during conversion.
Sample invocation would be ¶
``` var tc *TaskConfig hclutils.NewConfigParser(spec).ParseJson(t, configString, &tc) ```
type MapStrInt ¶
MapStrInt is a wrapper for map[string]int that handles deserialization from different hcl2 json representation that were supported in Nomad 0.8
func (*MapStrInt) CodecDecodeSelf ¶
func (*MapStrInt) CodecEncodeSelf ¶
type MapStrStr ¶
MapStrStr is a wrapper for map[string]string that handles deserialization from different hcl2 json representation that were supported in Nomad 0.8