Documentation
¶
Overview ¶
Package templates provides utility functions for use in Watchtower notification templates. This package defines a template.FuncMap with custom functions (e.g., ToJSON, ToUpper, ToLower, Title) that enhance the capabilities of Go templates used in the notification system, particularly for the template preview tool. These functions are integrated with the template rendering process in pkg/notifications/preview/tplprev.go and used with templates defined in pkg/notifications/common_templates.go, enabling dynamic formatting of notification data (e.g., JSON marshaling, string case conversion) for display in the web interface (docs/notifications/template-preview/index.md).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Funcs = template.FuncMap{ "ToUpper": strings.ToUpper, "ToLower": strings.ToLower, "ToJSON": toJSON, "Title": cases.Title(language.AmericanEnglish).String, }
Funcs defines a set of utility functions for use in notification templates.
Functions ¶
This section is empty.
Types ¶
This section is empty.