Documentation ¶
Overview ¶
Package template implements functions to render Go templates to files using the node.Node struct as an imnput for the templates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigFileAbsent ¶
ConfigFileAbsent deletes a file if it exists
func ConfigFileRendered ¶
func ConfigFileRendered(filepath, templateContent string, templateData TemplateData) error
ConfigFileRendered renders a template with node confguration and writes it to disk if it doesn't exist yet
In order to allow comma separated lists in the template it defines the template function `notLast` which can be used like this:
{{range $index, $id:= .Config.core.quorum_set_ids -}} "${{ $id }}"{{if notLast $index $.Config.core.quorum_set_ids}},{{end}} {{end -}}
func ConfigFilesRendered ¶
func ConfigFilesRendered(filenamesAndTemplates map[string]string, templateData TemplateData) error
ConfigFilesRendered renderes multiple templates to files
Types ¶
type TemplateData ¶
TemplateData wraps the data send to the rendering engine
Click to show internal directories.
Click to hide internal directories.