Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FnFileRead = func(fs afero.Afero) function.Function { return function.New( &function.Spec{ Params: []function.Parameter{ {Name: "path", Type: cty.String}, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { path := args[0].AsString() content, err := fs.ReadFile(path) if err != nil { return cty.NilVal, err } return cty.StringVal(string(content)), nil }, }, ) }
FnFileRead reads the whole file or returns error. https://github.com/hashicorp/hcl/blob/main/guide/go_expression_eval.rst
Functions ¶
func EvalContext ¶
EvalContext builds default EvalContext for hcl parser.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.