mirror of
https://github.com/crazy-max/diun.git
synced 2025-01-12 11:38:11 +00:00
26 lines
1.2 KiB
Go
26 lines
1.2 KiB
Go
package model
|
|
|
|
// NotifPushover holds Pushover notification configuration details
|
|
type NotifPushover struct {
|
|
Token string `yaml:"token,omitempty" json:"token,omitempty" validate:"omitempty"`
|
|
TokenFile string `yaml:"tokenFile,omitempty" json:"tokenFile,omitempty" validate:"omitempty,file"`
|
|
Recipient string `yaml:"recipient,omitempty" json:"recipient,omitempty" validate:"omitempty"`
|
|
RecipientFile string `yaml:"recipientFile,omitempty" json:"recipientFile,omitempty" validate:"omitempty,file"`
|
|
Priority int `yaml:"priority,omitempty" json:"priority,omitempty" validate:"omitempty,min=-2,max=2"`
|
|
Sound string `yaml:"sound,omitempty" json:"sound,omitempty" validate:"omitempty"`
|
|
TemplateTitle string `yaml:"templateTitle,omitempty" json:"templateTitle,omitempty" validate:"required"`
|
|
TemplateBody string `yaml:"templateBody,omitempty" json:"templateBody,omitempty" validate:"required"`
|
|
}
|
|
|
|
// GetDefaults gets the default values
|
|
func (s *NotifPushover) GetDefaults() *NotifPushover {
|
|
n := &NotifPushover{}
|
|
n.SetDefaults()
|
|
return n
|
|
}
|
|
|
|
// SetDefaults sets the default values
|
|
func (s *NotifPushover) SetDefaults() {
|
|
s.TemplateTitle = NotifDefaultTemplateTitle
|
|
s.TemplateBody = NotifDefaultTemplateBody
|
|
}
|