mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02:00
feat(notifications): add json template (#1542)
This commit is contained in:
parent
8464e0dece
commit
547d033460
5 changed files with 211 additions and 14 deletions
|
@ -210,6 +210,7 @@ func getShoutrrrTemplate(tplString string, legacy bool) (tpl *template.Template,
|
|||
funcs := template.FuncMap{
|
||||
"ToUpper": strings.ToUpper,
|
||||
"ToLower": strings.ToLower,
|
||||
"ToJSON": toJSON,
|
||||
"Title": cases.Title(language.AmericanEnglish).String,
|
||||
}
|
||||
tplBase := template.New("").Funcs(funcs)
|
||||
|
@ -240,16 +241,3 @@ func getShoutrrrTemplate(tplString string, legacy bool) (tpl *template.Template,
|
|||
|
||||
return
|
||||
}
|
||||
|
||||
// StaticData is the part of the notification template data model set upon initialization
|
||||
type StaticData struct {
|
||||
Title string
|
||||
Host string
|
||||
}
|
||||
|
||||
// Data is the notification template data model
|
||||
type Data struct {
|
||||
StaticData
|
||||
Entries []*log.Entry
|
||||
Report t.Report
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue