Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regen TOC #1901

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 116 additions & 99 deletions docs/templating-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,111 +5,127 @@ format. If you are not familiar with the syntax, please read Go's documentation
and examples. In addition to the Go-provided template functions, Consul Template
provides the following functions:

[comment]: <> (Generated from https://derlin.github.io/bitdowntoc/)
- [API Functions](#api-functions)
- [caLeaf](#caleaf)
- [caRoots](#caroots)
- [connect](#connect)
- [datacenters](#datacenters)
- [file](#file)
- [key](#key)
- [keyExists](#keyexists)
- [keyOrDefault](#keyordefault)
- [ls](#ls)
- [safeLs](#safels)
- [node](#node)
- [nodes](#nodes)
- [secret](#secret)
- [secrets](#secrets)
- [pkiCert](#pkicert)
- [service](#service)
- [services](#services)
- [tree](#tree)
- [safeTree](#safetree)
* [`caLeaf`](#caleaf)
* [`caRoots`](#caroots)
* [`connect`](#connect)
* [`datacenters`](#datacenters)
* [`file`](#file)
* [`key`](#key)
* [`keyExists`](#keyexists)
* [`keyOrDefault`](#keyordefault)
* [`ls`](#ls)
* [`safeLs`](#safels)
* [`node`](#node)
* [`nodes`](#nodes)
* [`peerings`](#peerings)
* [`secret`](#secret)
+ [Format](#format)
+ [Simple Read](#simple-read)
+ [Versioned Read](#versioned-read)
+ [Write (and Read back)](#write-and-read-back)
* [`secrets`](#secrets)
* [`pkiCert`](#pkicert)
* [`service`](#service)
* [`services`](#services)
* [`tree`](#tree)
* [`safeTree`](#safetree)
- [Scratch](#scratch)
- [scratch.Key](#scratchkey)
- [scratch.Get](#scratchget)
- [scratch.Set](#scratchset)
- [scratch.SetX](#scratchsetx)
- [scratch.MapSet](#scratchmapset)
- [scratch.MapSetX](#scratchmapsetx)
- [scratch.MapValues](#scratchmapvalues)
* [`scratch.Key`](#scratchkey)
* [`scratch.Get`](#scratchget)
* [`scratch.Set`](#scratchset)
* [`scratch.SetX`](#scratchsetx)
* [`scratch.MapSet`](#scratchmapset)
* [`scratch.MapSetX`](#scratchmapsetx)
* [`scratch.MapValues`](#scratchmapvalues)
- [Helper Functions](#helper-functions)
- [base64Decode](#base64decode)
- [base64Encode](#base64encode)
- [base64URLDecode](#base64urldecode)
- [base64URLEncode](#base64urlencode)
- [byKey](#bykey)
- [byTag](#bytag)
- [byMeta](#bymeta)
- [contains](#contains)
- [containsAll](#containsall)
- [containsAny](#containsany)
- [containsNone](#containsnone)
- [containsNotAll](#containsnotall)
- [env](#env)
- [mustEnv](#mustEnv)
- [envOrDefault](#envOrDefault)
- [executeTemplate](#executetemplate)
- [explode](#explode)
- [explodeMap](#explodemap)
- [indent](#indent)
- [in](#in)
- [loop](#loop)
- [join](#join)
- [mergeMap](#mergemap)
- [mergeMapWithOverride](#mergemapwithoverride)
- [trimSpace](#trimspace)
- [trim](#trim)
- [trimPrefix](#trimprefix)
- [trimSuffix](#trimsuffix)
- [parseBool](#parsebool)
- [parseFloat](#parsefloat)
- [parseInt](#parseint)
- [parseJSON](#parsejson)
- [parseUint](#parseuint)
- [parseYAML](#parseyaml)
- [plugin](#plugin)
- [regexMatch](#regexmatch)
- [regexReplaceAll](#regexreplaceall)
- [replaceAll](#replaceall)
- [sha256Hex](#sha256hex)
- [md5sum](#md5sum)
- [hmacSHA256Hex](#hmacSHA256hex)
- [split](#split)
- [splitToMap](#splitToMap)
- [timestamp](#timestamp)
- [toJSON](#tojson)
- [toJSONPretty](#tojsonpretty)
- [toUnescapedJSON](#tounescapedjson)
- [toUnescapedJSONPretty](#tounescapedjsonpretty)
- [toLower](#tolower)
- [toTitle](#totitle)
- [toTOML](#totoml)
- [toUpper](#toupper)
- [toYAML](#toyaml)
- [sockaddr](#sockaddr)
- [writeToFile](#writeToFile)
* [`base64Decode`](#base64decode)
* [`base64Encode`](#base64encode)
* [`base64URLDecode`](#base64urldecode)
* [`base64URLEncode`](#base64urlencode)
* [`byKey`](#bykey)
* [`byTag`](#bytag)
* [`byMeta`](#bymeta)
* [`contains`](#contains)
* [`containsAll`](#containsall)
* [`containsAny`](#containsany)
* [`containsNone`](#containsnone)
* [`containsNotAll`](#containsnotall)
* [`env`](#env)
* [`mustEnv`](#mustenv)
* [`envOrDefault`](#envordefault)
* [`executeTemplate`](#executetemplate)
* [`explode`](#explode)
* [`explodeMap`](#explodemap)
* [`indent`](#indent)
* [`in`](#in)
* [`loop`](#loop)
* [`join`](#join)
* [`mergeMap`](#mergemap)
* [`mergeMapWithOverride`](#mergemapwithoverride)
* [`trimSpace`](#trimspace)
* [`trim`](#trim)
* [`trimPrefix`](#trimprefix)
* [`trimSuffix`](#trimsuffix)
* [`parseBool`](#parsebool)
* [`parseFloat`](#parsefloat)
* [`parseInt`](#parseint)
* [`parseJSON`](#parsejson)
* [`parseUint`](#parseuint)
* [`parseYAML`](#parseyaml)
* [`plugin`](#plugin)
* [`regexMatch`](#regexmatch)
* [`regexReplaceAll`](#regexreplaceall)
* [`replaceAll`](#replaceall)
* [`sha256Hex`](#sha256hex)
* [`md5sum`](#md5sum)
* [`hmacSHA256Hex`](#hmacsha256hex)
* [`split`](#split)
* [`splitToMap`](#splittomap)
* [`timestamp`](#timestamp)
* [`toJSON`](#tojson)
* [`toJSONPretty`](#tojsonpretty)
- [`toUnescapedJSON`](#tounescapedjson)
- [`toUnescapedJSONPretty`](#tounescapedjsonpretty)
* [`toLower`](#tolower)
* [`toTitle`](#totitle)
* [`toTOML`](#totoml)
* [`toUpper`](#toupper)
* [`toYAML`](#toyaml)
* [`sockaddr`](#sockaddr)
* [`writeToFile`](#writetofile)
- [Sprig Functions](#sprig-functions)
- [Math Functions](#math-functions)
- [add](#add)
- [subtract](#subtract)
- [multiply](#multiply)
- [divide](#divide)
- [modulo](#modulo)
- [minimum](#minimum)
- [maximum](#maximum)
* [`add`](#add)
* [`subtract`](#subtract)
* [`multiply`](#multiply)
* [`divide`](#divide)
* [`modulo`](#modulo)
* [`minimum`](#minimum)
* [`maximum`](#maximum)
- [Nomad Functions](#nomad-functions)
- [nomadServices](#nomadservices)
- [nomadService](#nomadservice)
- [nomadVarList](#nomadvarlist)
- [nomadVarListSafe](#nomadvarlistsafe)
- [nomadVar](#nomadvar)
- [nomadVarExists](#nomadvarexists)
- [Debugging Functions](#debugging)
- [spew_dump](#spew_dump)
- [spew_sdump](#spew_sdump)
- [spew_printf](#spew_printf)
- [spew_sprintf](#spew_sdump)
* [`nomadServices`](#nomadservices)
* [`nomadService`](#nomadservice)
- [Nomad Variables](#nomad-variables)
* [`nomadVarList`](#nomadvarlist)
* [`nomadVarListSafe`](#nomadvarlistsafe)
+ [The `NomadVarMeta` Type](#the-nomadvarmeta-type)
* [`nomadVar`](#nomadvar)
+ [The `NomadVarItems` Type](#the-nomadvaritems-type)
+ [The `NomadVarItem` Type](#the-nomadvaritem-type)
* [`nomadVarExists`](#nomadvarexists)
- [Debugging Functions](#debugging-functions)
* [`spew_dump`](#spew_dump)
* [`spew_sdump`](#spew_sdump)
* [`spew_printf`](#spew_printf)
+ [using `%v`](#using-v)
+ [using `%+v`](#using-v-1)
+ [using `%+v`](#using-v-2)
+ [using `%#v`](#using-v-3)
+ [using `%+#v`](#using-v-4)
+ [using `%#v`](#using-v-5)
* [`spew_sprintf`](#spew_sprintf)

## API Functions

Expand Down Expand Up @@ -2266,3 +2282,4 @@ If you would prefer to use format strings with a compacted inline printing style
[text-template]: https://golang.org/pkg/text/template/ "Go's text/template package"
[vault]: https://www.vaultproject.io "Vault by HashiCorp"
[nomad]: https://www.nomadproject.io "Nomad by HashiCorp"

Loading