Skip to content

Commit

Permalink
Add TF 1.3 timecmp as example
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanck committed Oct 14, 2022
1 parent cae065f commit ca85fec
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion internal/funcs/1.3/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
}

0 comments on commit ca85fec

Please sign in to comment.