diff --git a/internal/funcs/1.3/functions.go b/internal/funcs/1.3/functions.go index 62219998..1e6b9caa 100644 --- a/internal/funcs/1.3/functions.go +++ b/internal/funcs/1.3/functions.go @@ -3,6 +3,8 @@ package funcs import ( "github.com/hashicorp/go-version" "github.com/hashicorp/hcl-lang/schema" + "github.com/zclconf/go-cty/cty" + "github.com/zclconf/go-cty/cty/function" funcs_v0_15 "github.com/hashicorp/terraform-schema/internal/funcs/0.15" ) @@ -12,7 +14,22 @@ func Functions(v *version.Version) map[string]schema.FuncSignature { f["endswith"] = schema.FuncSignature{} // TODO! f["startswith"] = schema.FuncSignature{} // TODO! - f["timecmp"] = schema.FuncSignature{} // TODO! + f["timecmp"] = schema.FuncSignature{ + Description: "timecmp compares two timestamps and returns a number that represents the ordering of the instants those timestamps represent.", + Params: []function.Parameter{ + { + Name: "timestamp_a", + Description: "First timestamp for comparison.", + Type: cty.String, + }, + { + Name: "timestamp_b", + Description: "Second timestamp for comparison.", + Type: cty.String, + }, + }, + ReturnTypes: cty.Number, + } return f }