Documentation ¶
Index ¶
- Constants
- func GetFooter() string
- func SendMail(s *Setting, to, cc, title, content string) error
- func SendMobileNotification(webhook string, title string, content string) error
- type MailTheme
- type MailThemeFlat
- type ResBody
- type SendPayload
- type Service
- func (svc *Service) DeleteSetting(id primitive.ObjectID) (err error)
- func (svc *Service) DisableSetting(id primitive.ObjectID) (err error)
- func (svc *Service) EnableSetting(id primitive.ObjectID) (err error)
- func (svc *Service) GetSetting(id primitive.ObjectID) (res *Setting, err error)
- func (svc *Service) GetSettingList(query bson.M, pagination *entity.Pagination, sort bson.D) (res []Setting, total int, err error)
- func (svc *Service) GetTriggerList() (res []string, total int, err error)
- func (svc *Service) Init() (err error)
- func (svc *Service) PosSetting(s *Setting) (err error)
- func (svc *Service) PutSetting(id primitive.ObjectID, s Setting) (err error)
- func (svc *Service) Start() (err error)
- func (svc *Service) Stop() (err error)
- type Setting
- type SettingMail
- type SettingMobile
- type SettingTarget
- type SettingTrigger
Constants ¶
View Source
const ( ExtraValueTypeNotification = "notification" ExtraValueModelGlobal = "global" )
View Source
const ( TypeMail = "mail" TypeMobile = "mobile" )
View Source
const (
PluginName = "notification"
)
View Source
const (
SettingsColName = "notification_settings"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MailThemeFlat ¶
type MailThemeFlat struct{}
MailThemeFlat is a theme
func (*MailThemeFlat) GetStyle ¶
func (dt *MailThemeFlat) GetStyle() string
func (*MailThemeFlat) HTMLTemplate ¶
func (dt *MailThemeFlat) HTMLTemplate() string
HTMLTemplate returns a Golang template that will generate an HTML email.
func (*MailThemeFlat) Name ¶
func (dt *MailThemeFlat) Name() string
Name returns the name of the flat theme
func (*MailThemeFlat) PlainTextTemplate ¶
func (dt *MailThemeFlat) PlainTextTemplate() string
PlainTextTemplate returns a Golang template that will generate an plain text email.
type SendPayload ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func GetService ¶
func GetService() *Service
func NewService ¶
func NewService() *Service
func (*Service) DeleteSetting ¶
func (*Service) DisableSetting ¶
func (*Service) EnableSetting ¶
func (*Service) GetSetting ¶
func (*Service) GetSettingList ¶
func (*Service) GetTriggerList ¶
func (*Service) PosSetting ¶
func (*Service) PutSetting ¶
type Setting ¶
type Setting struct { Id primitive.ObjectID `json:"_id" bson:"_id"` Type string `json:"type" bson:"type"` Name string `json:"name" bson:"name"` Description string `json:"description" bson:"description"` Enabled bool `json:"enabled" bson:"enabled"` Global bool `json:"global" bson:"global"` Title string `json:"title,omitempty" bson:"title,omitempty"` Template string `json:"template,omitempty" bson:"template,omitempty"` Triggers []string `json:"triggers" bson:"triggers"` Targets []SettingTarget `json:"targets" bson:"targets"` // TODO: implement Mail SettingMail `json:"mail,omitempty" bson:"mail,omitempty"` Mobile SettingMobile `json:"mobile,omitempty" bson:"mobile,omitempty"` }
type SettingMail ¶
type SettingMail struct { Server string `json:"server" bson:"server"` Port string `json:"port,omitempty" bson:"port,omitempty"` User string `json:"user,omitempty" bson:"user,omitempty"` Password string `json:"password,omitempty" bson:"password,omitempty"` SenderEmail string `json:"sender_email,omitempty" bson:"sender_email,omitempty"` SenderIdentity string `json:"sender_identity,omitempty" bson:"sender_identity,omitempty"` To string `json:"to,omitempty" bson:"to,omitempty"` Cc string `json:"cc,omitempty" bson:"cc,omitempty"` }
type SettingMobile ¶
type SettingMobile struct {
Webhook string `json:"webhook" bson:"webhook"`
}
type SettingTarget ¶
type SettingTrigger ¶
Click to show internal directories.
Click to hide internal directories.