databricks-cli/libs/template
shreyas-goenka 6c644e159c
Add map and pair helper functions for bundle templates (#665)
## Changes
Go text templates allows only specifying one input argument for
invocations of associated templates (ie `{{template ...}}`). This PR
introduces the map and pair functions which allow template authors to
work around this limitation by passing multiple arguments as key value
pairs in a map.

This PR is based on feedback from the mlops stacks migration where
otherwise a bunch of duplicate code is required for computed values and
fixtures.

## Tests
Unit test
2023-08-15 16:07:22 +00:00
..
testdata Add map and pair helper functions for bundle templates (#665) 2023-08-15 16:07:22 +00:00
config.go Use custom prompter for bundle template inputs (#663) 2023-08-15 14:50:20 +00:00
config_test.go Return better error messages for invalid JSON schema types in templates (#661) 2023-08-15 14:28:04 +00:00
file.go Only treat files with .tmpl extension as templates (#594) 2023-08-01 13:43:27 +00:00
file_test.go Only treat files with .tmpl extension as templates (#594) 2023-08-01 13:43:27 +00:00
helpers.go Add map and pair helper functions for bundle templates (#665) 2023-08-15 16:07:22 +00:00
helpers_test.go Add map and pair helper functions for bundle templates (#665) 2023-08-15 16:07:22 +00:00
materialize.go Add bundle init command and support for prompting user for input values (#631) 2023-08-07 13:14:25 +00:00
renderer.go Upgraded Go version to 1.21 (#664) 2023-08-15 13:50:40 +00:00
renderer_test.go Execute paths without the .tmpl extension as templates (#654) 2023-08-11 13:48:32 +00:00
utils.go Return better error messages for invalid JSON schema types in templates (#661) 2023-08-15 14:28:04 +00:00
utils_test.go Return better error messages for invalid JSON schema types in templates (#661) 2023-08-15 14:28:04 +00:00
validators.go Upgraded Go version to 1.21 (#664) 2023-08-15 13:50:40 +00:00
validators_test.go Add bundle init command and support for prompting user for input values (#631) 2023-08-07 13:14:25 +00:00