Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodingenthusiast committed Nov 21, 2023
1 parent bc26189 commit 92a8725
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions docs/templating-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ blocking, use [`keyOrDefault`](#keyordefault) or [`keyExists`](#keyexists).
The `<QUERY>` attribute is optional; if omitted, the `default` Consul namespace, `default` partition will be queried. `<QUERY>` can be used to set the Consul [namespace](https://developer.hashicorp.com/consul/api-docs/health#ns-2) or partition. `<QUERY>` accepts a url query-parameter format, e.g.:

```golang
{{ service "key?ns=namespace-name&partition=partition-name" }}
{{ key "key?ns=namespace-name&partition=partition-name" }}
```

The `<DATACENTER>` attribute is optional; if omitted, the local datacenter is
Expand Down Expand Up @@ -348,7 +348,15 @@ instead.
Query [Consul][consul] for all top-level kv pairs at the given key path.

```golang
{{ ls "<PATH>@<DATACENTER>" }}
{{ ls "<PATH>?<QUERY>@<DATACENTER>" }}
```

The `<QUERY>` attribute is optional; if omitted, the `default` Consul namespace, `default` partition will be queried. `<QUERY>` can be used to set the Consul [namespace](https://developer.hashicorp.com/consul/api-docs/health#ns-2) or partition. `<QUERY>` accepts a url query-parameter format, e.g.:

```golang
{{ range ls "service/redis?ns=namespace-name&partition=partition-name" }}
{{ .Key }}:{{ .Value }}
{{ end }}
```

The `<DATACENTER>` attribute is optional; if omitted, the local datacenter is
Expand All @@ -358,7 +366,8 @@ For example:

```golang
{{ range ls "service/redis" }}
{{ .Key }}:{{ .Value }}{{ end }}
{{ .Key }}:{{ .Value }}
{{ end }}
```

renders
Expand Down

0 comments on commit 92a8725

Please sign in to comment.