diff options
| author | jeevansai <jeevansai502@gmail.com> | 2022-02-05 19:52:00 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-05 09:22:00 -0500 |
| commit | 0ca223237a0714eebe4e8f3da10e09031999537f (patch) | |
| tree | 0d0d45c2905558545e866939b72b41b12992dcca /docs-src/content/functions/data.yml | |
| parent | d3a425a554342986cf20dd70e6327e0598dcfd91 (diff) | |
Add function to list datasources (#1287)
* Add function to list datasources
* Sort datasources in ascending order and return in listDatasources
* Fix lint error
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Co-authored-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'docs-src/content/functions/data.yml')
| -rw-r--r-- | docs-src/content/functions/data.yml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs-src/content/functions/data.yml b/docs-src/content/functions/data.yml index 15106372..8fa47736 100644 --- a/docs-src/content/functions/data.yml +++ b/docs-src/content/functions/data.yml @@ -62,6 +62,15 @@ funcs: - | $ gomplate -i '{{if (datasourceReachable "test")}}{{datasource "test"}}{{else}}no worries{{end}}' -d test=https://bogus.example.com/wontwork.json no worries + - name: listDatasources + description: | + Lists all the datasources defined, list returned will be sorted in ascending order. + pipeline: false + examples: + - | + $ gomplate -d person=env:///FOO -d bar=env:///BAR -i '{{range (listDatasources)}} Datasource-{{.}} {{end}}' + Datasource-bar + Datasource-person - name: defineDatasource description: | Define a datasource alias with target URL inside the template. Overridden by the [`--datasource/-d`](../../usage/#datasource-d) flag. |
