You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -105,9 +105,14 @@ Within those templates, the object emitted by docker-gen will have [this structu
105
105
106
106
#### Functions
107
107
108
+
**`closest $array $value`: Returns the longest matching substring in `$array` that matches `$value`
109
+
**`coalesce ...`*: Returns the first non-nil argument.
108
110
**`contains $map $key`*: Returns `true` if `$map` contains `$key`. Takes maps from `string` to `string`.
111
+
**`dir $path`: Returns an array of filenames in the specified `$path`.
109
112
**`exists $path`*: Returns `true` if `$path` refers to an existing file or directory. Takes a string.
113
+
**`first $array`*: Returns the first value of an array or nil if the arry is nil or empty.
110
114
**`groupBy $containers $fieldPath`*: Groups an array of `RuntimeContainer` instances based on the values of a field path expression `$fieldPath`. A field path expression is a dot-delimited list of map keys or struct member names specifying the path from container to a nested value, which must be a string. Returns a map from the value of the field path expression to an array of containers having that value. Containers that do not have a value for the field path in question are omitted.
115
+
**`groupByKeys $containers $fieldPath`*: Returns the same as `groupBy` but only returns the keys of the map.
111
116
**`groupByMulti $containers $fieldPath $sep`*: Like `groupBy`, but the string value specified by `$fieldPath` is first split by `$sep` into a list of strings. A container whose `$fieldPath` value contains a list of strings will show up in the map output under each of those strings.
112
117
**`split $string $sep`*: Splits `$string` into a slice of substrings delimited by `$sep`. Alias for [`strings.Split`](http://golang.org/pkg/strings/#Split)
113
118
**`replace $string $old $new $count`*: Replaces up to `$count` occurences of `$old` with `$new` in `$string`. Alias for [`strings.Replace`](http://golang.org/pkg/strings/#Replace)
0 commit comments