From 2472f437a6b3f1244508368410fdfca55e157e5d Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Thu, 10 Feb 2022 08:43:36 -0500 Subject: conv.URL - add example of how to redact the password Signed-off-by: Dave Henderson --- docs-src/content/functions/conv.yml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs-src') diff --git a/docs-src/content/functions/conv.yml b/docs-src/content/functions/conv.yml index 09ef6105..10aa2fc3 100644 --- a/docs-src/content/functions/conv.yml +++ b/docs-src/content/functions/conv.yml @@ -147,6 +147,8 @@ funcs: alias: urlParse description: | Parses a string as a URL for later use. Equivalent to [url.Parse](https://golang.org/pkg/net/url/#Parse) + + Any of `url.URL`'s methods can be called on the result. arguments: - name: in required: true @@ -167,6 +169,12 @@ funcs: The host is example.com:443 The path is /foo/bar ``` + - | + _Call `Redacted` to hide the password in the output:_ + ``` + $ gomplate -i '{{ (conv.URL "https://user:supersecret@example.com").Redacted }}' + https://user:xxxxx@example.com + ``` - name: conv.ParseInt description: | _**Note:**_ See [`conv.ToInt64`](#conv-toint64) instead for a simpler and more flexible variant of this function. -- cgit v1.2.3