Skip to content

Commit

Permalink
Added some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jussi Nummelin committed Sep 9, 2015
1 parent fba7d90 commit 0c213c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
9 changes: 0 additions & 9 deletions Dockerfile

This file was deleted.

11 changes: 10 additions & 1 deletion docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,16 @@ Alias for the strings.Join function.
services: {{join $services ","}}
```

### lookupIP

Wrapper for net.LookupIP function. The wrapper also sorts (alphabeticaly) the IP addresses. This is crucial since in dynamic environments DNS servers typically shuffle the addresses linked to domain name. And that would cause unnecessary config reloads.

```
{{range lookupIP "some.host.local"}}
server {{.}};
{{end}}
```

## Example Usage

```Bash
Expand Down Expand Up @@ -380,4 +390,3 @@ server {
```

Go's [`text/template`](http://golang.org/pkg/text/template/) package is very powerful. For more details on it's capabilities see its [documentation.](http://golang.org/pkg/text/template/)

Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func LookupIP(data string) ([]string) {
if(err != nil) {
return nil
}
// "Cast" IPs into strings and sort the array
ipStrings := make([]string, len(ips))

for i, ip := range ips {
Expand Down

0 comments on commit 0c213c9

Please sign in to comment.