templates

package
v0.0.0-...-5840427 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL