Debian Codegraph @

pkg/types/params.go

raw
1 package types
2
3 // Params is the string map used to provide additional variables to the service templates.
4 type Params map[string]string
5
6 const (
7 // TitleKey is the common key for the title prop.
8 TitleKey = "title"
9 // MessageKey is the common key for the message prop.
10 MessageKey = "message"
11 )
12
13 // SetMessage sets the "message" param to the specified value.
14 func (p Params) SetMessage(message string) {
15 p[MessageKey] = message
16 }
17
18 // SetTitle sets the "title" param to the specified value.
19 func (p Params) SetTitle(title string) {
20 p[TitleKey] = title
21 }
22
23 // Title returns the "title" param.
24 func (p Params) Title() (string, bool) {
25 title, found := p[TitleKey]
26
27 return title, found
28 }