mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-24 06:28:13 +01:00
* Add Matrix notification (#124) * Fix docs Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
24 lines
963 B
Go
24 lines
963 B
Go
package model
|
|
|
|
// NotifMatrix holds Matrix notification configuration details
|
|
type NotifMatrix struct {
|
|
HomeserverURL string `yaml:"homeserverURL,omitempty" json:"homeserverURL,omitempty" validate:"required"`
|
|
User string `yaml:"user,omitempty" json:"user,omitempty" validate:"omitempty"`
|
|
UserFile string `yaml:"userFile,omitempty" json:"userFile,omitempty" validate:"omitempty,file"`
|
|
Password string `yaml:"password,omitempty" json:"password,omitempty" validate:"omitempty"`
|
|
PasswordFile string `yaml:"passwordFile,omitempty" json:"passwordFile,omitempty" validate:"omitempty,file"`
|
|
RoomID string `yaml:"roomID,omitempty" json:"roomID,omitempty" validate:"required"`
|
|
}
|
|
|
|
// GetDefaults gets the default values
|
|
func (s *NotifMatrix) GetDefaults() *NotifMatrix {
|
|
n := &NotifMatrix{}
|
|
n.SetDefaults()
|
|
return n
|
|
}
|
|
|
|
// SetDefaults sets the default values
|
|
func (s *NotifMatrix) SetDefaults() {
|
|
s.HomeserverURL = "https://matrix.org"
|
|
}
|