package tryfunc

import "github.com/hashicorp/hcl/v2/ext/tryfunc"

Package tryfunc contains some optional functions that can be exposed in HCL-based languages to allow authors to test whether a particular expression can succeed and take dynamic action based on that result.

These functions are implemented in terms of the customdecode extension from the sibling directory "customdecode", and so they are only useful when used within an HCL EvalContext. Other systems using cty functions are unlikely to support the HCL-specific "customdecode" extension.

Index

Variables

var CanFunc function.Function

CanFunc tries to evaluate the expression given in its first argument.

var TryFunc function.Function

TryFunc is a variadic function that tries to evaluate all of is arguments in sequence until one succeeds, in which case it returns that result, or returns an error if none of them succeed.

Source Files

tryfunc.go

Version
v2.10.1
Published
Jul 21, 2021
Platform
js/wasm
Imports
7 packages
Last checked
10 hours ago

Tools for package owners.