6c3ae68a0e
In a few specific portions of the spec format it's convenient to have access to some of the functions defined in the cty stdlib. Here we allow them to be used when constructing the value for a "literal" spec and in the result expression for a "transform" spec.
25 lines
679 B
Go
25 lines
679 B
Go
package main
|
|
|
|
import (
|
|
"github.com/zclconf/go-cty/cty/function"
|
|
"github.com/zclconf/go-cty/cty/function/stdlib"
|
|
)
|
|
|
|
var specFuncs = map[string]function.Function{
|
|
"abs": stdlib.AbsoluteFunc,
|
|
"coalesce": stdlib.CoalesceFunc,
|
|
"concat": stdlib.ConcatFunc,
|
|
"hasindex": stdlib.HasIndexFunc,
|
|
"int": stdlib.IntFunc,
|
|
"jsondecode": stdlib.JSONDecodeFunc,
|
|
"jsonencode": stdlib.JSONEncodeFunc,
|
|
"length": stdlib.LengthFunc,
|
|
"lower": stdlib.LowerFunc,
|
|
"max": stdlib.MaxFunc,
|
|
"min": stdlib.MinFunc,
|
|
"reverse": stdlib.ReverseFunc,
|
|
"strlen": stdlib.StrlenFunc,
|
|
"substr": stdlib.SubstrFunc,
|
|
"upper": stdlib.UpperFunc,
|
|
}
|