diff options
author | Radek Simko <radek.simko@gmail.com> | 2017-08-10 14:38:14 +0200 |
---|---|---|
committer | Radek Simko <radek.simko@gmail.com> | 2017-08-10 14:38:14 +0200 |
commit | c680a8e1622ed0f18751d9d167c836ee24f5e897 (patch) | |
tree | 864f925049d422033dd25a73bafce32b361c8827 /vendor/github.com/hashicorp/terraform/config/interpolate_funcs.go | |
parent | 38f8880ac81bfabc6d7f82e4dc89661f20fc559e (diff) | |
download | terraform-provider-statuscake-c680a8e1622ed0f18751d9d167c836ee24f5e897.tar.gz terraform-provider-statuscake-c680a8e1622ed0f18751d9d167c836ee24f5e897.tar.zst terraform-provider-statuscake-c680a8e1622ed0f18751d9d167c836ee24f5e897.zip |
vendor: github.com/hashicorp/terraform/...@v0.10.0
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/config/interpolate_funcs.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/config/interpolate_funcs.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/config/interpolate_funcs.go b/vendor/github.com/hashicorp/terraform/config/interpolate_funcs.go index 7b7b3f2..a298cf2 100644 --- a/vendor/github.com/hashicorp/terraform/config/interpolate_funcs.go +++ b/vendor/github.com/hashicorp/terraform/config/interpolate_funcs.go | |||
@@ -70,6 +70,7 @@ func Funcs() map[string]ast.Function { | |||
70 | "coalescelist": interpolationFuncCoalesceList(), | 70 | "coalescelist": interpolationFuncCoalesceList(), |
71 | "compact": interpolationFuncCompact(), | 71 | "compact": interpolationFuncCompact(), |
72 | "concat": interpolationFuncConcat(), | 72 | "concat": interpolationFuncConcat(), |
73 | "contains": interpolationFuncContains(), | ||
73 | "dirname": interpolationFuncDirname(), | 74 | "dirname": interpolationFuncDirname(), |
74 | "distinct": interpolationFuncDistinct(), | 75 | "distinct": interpolationFuncDistinct(), |
75 | "element": interpolationFuncElement(), | 76 | "element": interpolationFuncElement(), |
@@ -356,6 +357,22 @@ func interpolationFuncCoalesceList() ast.Function { | |||
356 | } | 357 | } |
357 | } | 358 | } |
358 | 359 | ||
360 | // interpolationFuncContains returns true if an element is in the list | ||
361 | // and return false otherwise | ||
362 | func interpolationFuncContains() ast.Function { | ||
363 | return ast.Function{ | ||
364 | ArgTypes: []ast.Type{ast.TypeList, ast.TypeString}, | ||
365 | ReturnType: ast.TypeBool, | ||
366 | Callback: func(args []interface{}) (interface{}, error) { | ||
367 | _, err := interpolationFuncIndex().Callback(args) | ||
368 | if err != nil { | ||
369 | return false, nil | ||
370 | } | ||
371 | return true, nil | ||
372 | }, | ||
373 | } | ||
374 | } | ||
375 | |||
359 | // interpolationFuncConcat implements the "concat" function that concatenates | 376 | // interpolationFuncConcat implements the "concat" function that concatenates |
360 | // multiple lists. | 377 | // multiple lists. |
361 | func interpolationFuncConcat() ast.Function { | 378 | func interpolationFuncConcat() ast.Function { |