mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-28 17:21:32 +02:00
While we do support process-wide variables ("proc.<name>"), there was no way to preset them from the configuration. This was particularly limiting their usefulness since configs involving them always had to first check if the variable was set prior to performing an operation. This patch adds a new "set-var" directive in the global section that supports setting the proc.<name> variables from an expression, like other set-var actions do. The syntax however follows what is already being done for setenv, which consists in having one argument for the variable name and another one for the expression. Only "constant" expressions are allowed here, such as "int", "str" etc, combined with arithmetic or string converters, and variable lookups. A few extra sample fetch keywords like "date", "rand" and "uuid" are also part of the constant expressions and may make sense to allow to create a random key or differentiate processes. The way it was done consists in parsing a dummy rule an executing the expression in the CFG_PARSE context, then releasing the expression. This is safe because the sample that variables store does not hold a back pointer to expression that created them.
The HAProxy documentation has been split into a number of different files for ease of use. Please refer to the following files depending on what you're looking for : - INSTALL for instructions on how to build and install HAProxy - BRANCHES to understand the project's life cycle and what version to use - LICENSE for the project's license - CONTRIBUTING for the process to follow to submit contributions The more detailed documentation is located into the doc/ directory : - doc/intro.txt for a quick introduction on HAProxy - doc/configuration.txt for the configuration's reference manual - doc/lua.txt for the Lua's reference manual - doc/SPOE.txt for how to use the SPOE engine - doc/network-namespaces.txt for how to use network namespaces under Linux - doc/management.txt for the management guide - doc/regression-testing.txt for how to use the regression testing suite - doc/peers.txt for the peers protocol reference - doc/coding-style.txt for how to adopt HAProxy's coding style - doc/internals for developer-specific documentation (not all up to date)
Description
Languages
C
98.1%
Shell
0.9%
Makefile
0.5%
Lua
0.2%
Python
0.1%