File: params.go

package info (click to toggle)
golang-github-nicholas-fedor-shoutrrr 0.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,680 kB
  • sloc: sh: 74; makefile: 58
file content (28 lines) | stat: -rw-r--r-- 688 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package types

const (
	// TitleKey is the common key for the title prop.
	TitleKey = "title"
	// MessageKey is the common key for the message prop.
	MessageKey = "message"
)

// Params is the string map used to provide additional variables to the service templates.
type Params map[string]string

// SetTitle sets the "title" param to the specified value.
func (p Params) SetTitle(title string) {
	p[TitleKey] = title
}

// Title returns the "title" param.
func (p Params) Title() (string, bool) {
	title, found := p[TitleKey]

	return title, found
}

// SetMessage sets the "message" param to the specified value.
func (p Params) SetMessage(message string) {
	p[MessageKey] = message
}