You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com> |
3 years ago | |
|---|---|---|
| .. | ||
| README.md | 5 years ago | |
| decode.go | 5 years ago | |
| doc.go | 3 years ago | |
| public.go | 5 years ago | |
README.md
HCL User Functions Extension
This HCL extension allows a calling application to support user-defined functions.
Functions are defined via a specific block type, like this:
function "add" {
params = [a, b]
result = a + b
}
function "list" {
params = []
variadic_param = items
result = items
}
The extension is implemented as a pre-processor for cty.Body objects. Given
a body that may contain functions, the DecodeUserFunctions function searches
for blocks that define functions and returns a functions map suitable for
inclusion in a hcl.EvalContext. It also returns a new cty.Body that
contains the remainder of the content from the given body, allowing for
further processing of remaining content.
For more information, see the godoc reference.