@@ -115,21 +115,24 @@ The *define* action names the file that will contain the processed template.
115
115
[cols="2*", options="header"]
116
116
|===
117
117
|Function | Meaning
118
- |`*endpointsForAlias(alias ServiceAliasConfig, svc ServiceUnit) []Endpoint*` | Returns the list of valid endpoints.
119
- |`*env(variable, default string) string*` | Tries to get the named environment variable from the pod. Returns the second
120
- argument if the variable cannot be read or is empty.
118
+ |`*processEndpointsForAlias(alias ServiceAliasConfig, svc ServiceUnit, action string) []Endpoint*` |
119
+ Returns the list of valid endpoints. When action is "shuffle", the order of endpoints is randomized.
120
+ |`*env(variable, default ...string) string*` | Tries to get the named environment variable from the pod.
121
+ If it is not defined or empty, it returns the optional second argument. Otherwise, it returns an empty string.
121
122
|`*matchPattern(pattern, s string) bool*` | The first argument is a string that contains the regular
122
- expression, the second argument is the variable to test. Returns a Boolean value indicating whether the regular
123
- expression provided as the first argument matches the string provided as the second argument.
123
+ expression, the second argument is the variable to test. Returns a Boolean value indicating whether
124
+ the regular expression provided as the first argument matches the string provided as the second argument.
124
125
|`*isInteger(s string) bool*` | Determines if a given variable is an integer.
125
- |`*matchValues(s string, allowedValues ...string) bool*` | Compares a given string to a list of allowed strings.
126
- |`*genSubdomainWildcardRegexp(hostname, path string, exactPath bool) string*` | Generates a regular expression matching the
127
- subdomain for hosts (and paths) with a wildcard policy.
128
- |`*generateRouteRegexp(hostname, path string, wildcard bool) string*` | Generates a regular expression matching the route
129
- hosts (and paths). The first argument is the host name, the second is the path,
126
+ |`*firstMatch(s string, allowedValues ...string) bool*` | Compares a given string to a list of allowed
127
+ strings. Returns first match scanning left to right through the list.
128
+ |`*matchValues(s string, allowedValues ...string) bool*` | Compares a given string to a list of allowed
129
+ strings. Returns "true" if the string is an allowed value, otherwise returns false.
130
+ |`*generateRouteRegexp(hostname, path string, wildcard bool) string*` | Generates a regular expression
131
+ matching the route hosts (and paths). The first argument is the host name, the second is the path,
130
132
and the third is a wildcard Boolean.
131
- |`*genCertificateHostName(hostname string, wildcard bool) string*` | Generates host name to use for serving/matching
132
- certificates. First argument is the host name and the second is the wildcard Boolean.
133
+ |`*genCertificateHostName(hostname string, wildcard bool) string*` | Generates host name to use for
134
+ serving/matching certificates. First argument is the host name and the second is the wildcard Boolean.
135
+ |`*isTrue(s string) bool*` | Determines if a given variable contains "true".
133
136
|===
134
137
135
138
These functions are provided by the HAProxy template router plug-in.
0 commit comments