summaryrefslogtreecommitdiff
path: root/docs-src/content/functions/data.yml
diff options
context:
space:
mode:
authorjeevansai <jeevansai502@gmail.com>2022-02-05 19:52:00 +0530
committerGitHub <noreply@github.com>2022-02-05 09:22:00 -0500
commit0ca223237a0714eebe4e8f3da10e09031999537f (patch)
tree0d0d45c2905558545e866939b72b41b12992dcca /docs-src/content/functions/data.yml
parentd3a425a554342986cf20dd70e6327e0598dcfd91 (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.yml9
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.