Templating
In many places of the configuration Bifröst can not only be customized by using static strings or numbers, but by using templates as well.
Bifröst uses the template engine of Go. A collection of rather good resources to learn can be found at HashiCrop's Nomand Developer documentation.
In the documentation of each Bifröst's component you may find the type the icon , followed by the corresponding context object (like Connection or Authorization). The result will be like:
Base types
Each base type (string, bool, uint32, ...) has a different handling in edge cases.
string
A template of type String is always rendered to a corresponding string - as it is.
Examples:
Foo{{ "Xyz" }}Bar
or will result inFooXyzBar
.Foo{{ 123 }}Bar
or will result inFoo123Bar
.
bool
A template of type Bool is always rendered into a boolean value (true
or false
). The following rules are evaluated to decide for either true
or false
:
false
: If the value trimmed and converted to lower-cases is one of:false
,disabled
,0
,no
,off
, <empty>,nil
ornull
true
: Everything else
uint32
A template of type uint32 is always rendered into an unsigned integer with 32 bits value (0
or more). An empty value is always assumed as 0
.
float32
A template of type float32 is always rendered into a floating point number with 32 bits value (0.0
or more). An empty value is always assumed as 0
.