convert cty func calls to stdlib
This commit is contained in:
parent
7d3fe3b404
commit
d0d85f909a
|
@ -41,22 +41,22 @@ func (s *Scope) Functions() map[string]function.Function {
|
||||||
"base64sha512": funcs.Base64Sha512Func,
|
"base64sha512": funcs.Base64Sha512Func,
|
||||||
"bcrypt": funcs.BcryptFunc,
|
"bcrypt": funcs.BcryptFunc,
|
||||||
"can": tryfunc.CanFunc,
|
"can": tryfunc.CanFunc,
|
||||||
"ceil": funcs.CeilFunc,
|
"ceil": stdlib.CeilFunc,
|
||||||
"chomp": funcs.ChompFunc,
|
"chomp": stdlib.ChompFunc,
|
||||||
"cidrhost": funcs.CidrHostFunc,
|
"cidrhost": funcs.CidrHostFunc,
|
||||||
"cidrnetmask": funcs.CidrNetmaskFunc,
|
"cidrnetmask": funcs.CidrNetmaskFunc,
|
||||||
"cidrsubnet": funcs.CidrSubnetFunc,
|
"cidrsubnet": funcs.CidrSubnetFunc,
|
||||||
"cidrsubnets": funcs.CidrSubnetsFunc,
|
"cidrsubnets": funcs.CidrSubnetsFunc,
|
||||||
"coalesce": funcs.CoalesceFunc,
|
"coalesce": funcs.CoalesceFunc,
|
||||||
"coalescelist": funcs.CoalesceListFunc,
|
"coalescelist": stdlib.CoalesceListFunc,
|
||||||
"compact": funcs.CompactFunc,
|
"compact": stdlib.CompactFunc,
|
||||||
"concat": stdlib.ConcatFunc,
|
"concat": stdlib.ConcatFunc,
|
||||||
"contains": funcs.ContainsFunc,
|
"contains": stdlib.ContainsFunc,
|
||||||
"csvdecode": stdlib.CSVDecodeFunc,
|
"csvdecode": stdlib.CSVDecodeFunc,
|
||||||
"dirname": funcs.DirnameFunc,
|
"dirname": funcs.DirnameFunc,
|
||||||
"distinct": funcs.DistinctFunc,
|
"distinct": stdlib.DistinctFunc,
|
||||||
"element": funcs.ElementFunc,
|
"element": stdlib.ElementFunc,
|
||||||
"chunklist": funcs.ChunklistFunc,
|
"chunklist": stdlib.ChunklistFunc,
|
||||||
"file": funcs.MakeFileFunc(s.BaseDir, false),
|
"file": funcs.MakeFileFunc(s.BaseDir, false),
|
||||||
"fileexists": funcs.MakeFileExistsFunc(s.BaseDir),
|
"fileexists": funcs.MakeFileExistsFunc(s.BaseDir),
|
||||||
"fileset": funcs.MakeFileSetFunc(s.BaseDir),
|
"fileset": funcs.MakeFileSetFunc(s.BaseDir),
|
||||||
|
@ -67,53 +67,53 @@ func (s *Scope) Functions() map[string]function.Function {
|
||||||
"filesha1": funcs.MakeFileSha1Func(s.BaseDir),
|
"filesha1": funcs.MakeFileSha1Func(s.BaseDir),
|
||||||
"filesha256": funcs.MakeFileSha256Func(s.BaseDir),
|
"filesha256": funcs.MakeFileSha256Func(s.BaseDir),
|
||||||
"filesha512": funcs.MakeFileSha512Func(s.BaseDir),
|
"filesha512": funcs.MakeFileSha512Func(s.BaseDir),
|
||||||
"flatten": funcs.FlattenFunc,
|
"flatten": stdlib.FlattenFunc,
|
||||||
"floor": funcs.FloorFunc,
|
"floor": stdlib.FloorFunc,
|
||||||
"format": stdlib.FormatFunc,
|
"format": stdlib.FormatFunc,
|
||||||
"formatdate": stdlib.FormatDateFunc,
|
"formatdate": stdlib.FormatDateFunc,
|
||||||
"formatlist": stdlib.FormatListFunc,
|
"formatlist": stdlib.FormatListFunc,
|
||||||
"indent": funcs.IndentFunc,
|
"indent": stdlib.IndentFunc,
|
||||||
"index": funcs.IndexFunc,
|
"index": funcs.IndexFunc, // stdlib.IndexFunc is not compatible
|
||||||
"join": funcs.JoinFunc,
|
"join": stdlib.JoinFunc,
|
||||||
"jsondecode": stdlib.JSONDecodeFunc,
|
"jsondecode": stdlib.JSONDecodeFunc,
|
||||||
"jsonencode": stdlib.JSONEncodeFunc,
|
"jsonencode": stdlib.JSONEncodeFunc,
|
||||||
"keys": funcs.KeysFunc,
|
"keys": stdlib.KeysFunc,
|
||||||
"length": funcs.LengthFunc,
|
"length": funcs.LengthFunc,
|
||||||
"list": funcs.ListFunc,
|
"list": funcs.ListFunc,
|
||||||
"log": funcs.LogFunc,
|
"log": stdlib.LogFunc,
|
||||||
"lookup": funcs.LookupFunc,
|
"lookup": funcs.LookupFunc,
|
||||||
"lower": stdlib.LowerFunc,
|
"lower": stdlib.LowerFunc,
|
||||||
"map": funcs.MapFunc,
|
"map": funcs.MapFunc,
|
||||||
"matchkeys": funcs.MatchkeysFunc,
|
"matchkeys": funcs.MatchkeysFunc,
|
||||||
"max": stdlib.MaxFunc,
|
"max": stdlib.MaxFunc,
|
||||||
"md5": funcs.Md5Func,
|
"md5": funcs.Md5Func,
|
||||||
"merge": funcs.MergeFunc,
|
"merge": stdlib.MergeFunc,
|
||||||
"min": stdlib.MinFunc,
|
"min": stdlib.MinFunc,
|
||||||
"parseint": funcs.ParseIntFunc,
|
"parseint": stdlib.ParseIntFunc,
|
||||||
"pathexpand": funcs.PathExpandFunc,
|
"pathexpand": funcs.PathExpandFunc,
|
||||||
"pow": funcs.PowFunc,
|
"pow": stdlib.PowFunc,
|
||||||
"range": stdlib.RangeFunc,
|
"range": stdlib.RangeFunc,
|
||||||
"regex": stdlib.RegexFunc,
|
"regex": stdlib.RegexFunc,
|
||||||
"regexall": stdlib.RegexAllFunc,
|
"regexall": stdlib.RegexAllFunc,
|
||||||
"replace": funcs.ReplaceFunc,
|
"replace": funcs.ReplaceFunc,
|
||||||
"reverse": funcs.ReverseFunc,
|
"reverse": stdlib.ReverseListFunc,
|
||||||
"rsadecrypt": funcs.RsaDecryptFunc,
|
"rsadecrypt": funcs.RsaDecryptFunc,
|
||||||
"setintersection": stdlib.SetIntersectionFunc,
|
"setintersection": stdlib.SetIntersectionFunc,
|
||||||
"setproduct": funcs.SetProductFunc,
|
"setproduct": stdlib.SetProductFunc,
|
||||||
"setsubtract": stdlib.SetSubtractFunc,
|
"setsubtract": stdlib.SetSubtractFunc,
|
||||||
"setunion": stdlib.SetUnionFunc,
|
"setunion": stdlib.SetUnionFunc,
|
||||||
"sha1": funcs.Sha1Func,
|
"sha1": funcs.Sha1Func,
|
||||||
"sha256": funcs.Sha256Func,
|
"sha256": funcs.Sha256Func,
|
||||||
"sha512": funcs.Sha512Func,
|
"sha512": funcs.Sha512Func,
|
||||||
"signum": funcs.SignumFunc,
|
"signum": stdlib.SignumFunc,
|
||||||
"slice": funcs.SliceFunc,
|
"slice": stdlib.SliceFunc,
|
||||||
"sort": funcs.SortFunc,
|
"sort": stdlib.SortFunc,
|
||||||
"split": funcs.SplitFunc,
|
"split": stdlib.SplitFunc,
|
||||||
"strrev": stdlib.ReverseFunc,
|
"strrev": stdlib.ReverseFunc,
|
||||||
"substr": stdlib.SubstrFunc,
|
"substr": stdlib.SubstrFunc,
|
||||||
"timestamp": funcs.TimestampFunc,
|
"timestamp": funcs.TimestampFunc,
|
||||||
"timeadd": funcs.TimeAddFunc,
|
"timeadd": stdlib.TimeAddFunc,
|
||||||
"title": funcs.TitleFunc,
|
"title": stdlib.TitleFunc,
|
||||||
"tostring": funcs.MakeToFunc(cty.String),
|
"tostring": funcs.MakeToFunc(cty.String),
|
||||||
"tonumber": funcs.MakeToFunc(cty.Number),
|
"tonumber": funcs.MakeToFunc(cty.Number),
|
||||||
"tobool": funcs.MakeToFunc(cty.Bool),
|
"tobool": funcs.MakeToFunc(cty.Bool),
|
||||||
|
@ -121,19 +121,19 @@ func (s *Scope) Functions() map[string]function.Function {
|
||||||
"tolist": funcs.MakeToFunc(cty.List(cty.DynamicPseudoType)),
|
"tolist": funcs.MakeToFunc(cty.List(cty.DynamicPseudoType)),
|
||||||
"tomap": funcs.MakeToFunc(cty.Map(cty.DynamicPseudoType)),
|
"tomap": funcs.MakeToFunc(cty.Map(cty.DynamicPseudoType)),
|
||||||
"transpose": funcs.TransposeFunc,
|
"transpose": funcs.TransposeFunc,
|
||||||
"trim": funcs.TrimFunc,
|
"trim": stdlib.TrimFunc,
|
||||||
"trimprefix": funcs.TrimPrefixFunc,
|
"trimprefix": stdlib.TrimPrefixFunc,
|
||||||
"trimspace": funcs.TrimSpaceFunc,
|
"trimspace": stdlib.TrimSpaceFunc,
|
||||||
"trimsuffix": funcs.TrimSuffixFunc,
|
"trimsuffix": stdlib.TrimSuffixFunc,
|
||||||
"try": tryfunc.TryFunc,
|
"try": tryfunc.TryFunc,
|
||||||
"upper": stdlib.UpperFunc,
|
"upper": stdlib.UpperFunc,
|
||||||
"urlencode": funcs.URLEncodeFunc,
|
"urlencode": funcs.URLEncodeFunc,
|
||||||
"uuid": funcs.UUIDFunc,
|
"uuid": funcs.UUIDFunc,
|
||||||
"uuidv5": funcs.UUIDV5Func,
|
"uuidv5": funcs.UUIDV5Func,
|
||||||
"values": funcs.ValuesFunc,
|
"values": stdlib.ValuesFunc,
|
||||||
"yamldecode": ctyyaml.YAMLDecodeFunc,
|
"yamldecode": ctyyaml.YAMLDecodeFunc,
|
||||||
"yamlencode": ctyyaml.YAMLEncodeFunc,
|
"yamlencode": ctyyaml.YAMLEncodeFunc,
|
||||||
"zipmap": funcs.ZipmapFunc,
|
"zipmap": stdlib.ZipmapFunc,
|
||||||
}
|
}
|
||||||
|
|
||||||
s.funcs["templatefile"] = funcs.MakeTemplateFileFunc(s.BaseDir, func() map[string]function.Function {
|
s.funcs["templatefile"] = funcs.MakeTemplateFileFunc(s.BaseDir, func() map[string]function.Function {
|
||||||
|
|
Loading…
Reference in New Issue