Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Email ¶
type Email struct { From string `json:"from"` To string `json:"to"` Subject string `json:"subject"` Body string `json:"template"` }
func (*Email) SetRender ¶
func (e *Email) SetRender(render *m.TemplateRender)
type Notify ¶
type Notify struct {
// contains filtered or unexported fields
}
func NewNotify ¶
func NewNotify( adaptor *adaptors.Adaptors, appCfg *config.AppConfig, graceful *graceful_service.GracefulService, scriptService *scripts.ScriptService) *Notify
func (*Notify) GetCfg ¶
func (n *Notify) GetCfg() *NotifyConfig
func (*Notify) Repeat ¶
func (n *Notify) Repeat(msg *m.MessageDelivery)
func (*Notify) Stat ¶
func (n *Notify) Stat() *NotifyStat
func (*Notify) UpdateCfg ¶
func (n *Notify) UpdateCfg(cfg *NotifyConfig) error
type NotifyBind ¶
type NotifyBind struct {
// contains filtered or unexported fields
}
Javascript Binding
Notifr()
.NewSMS() .NewEmail() .NewSlack(channel, text) .NewTelegram(text) .Send(msg)
func (*NotifyBind) NewEmail ¶
func (b *NotifyBind) NewEmail() *Email
func (*NotifyBind) NewSMS ¶
func (b *NotifyBind) NewSMS() *SMS
func (*NotifyBind) NewSlack ¶
func (b *NotifyBind) NewSlack(channel, text string) *SlackMessage
func (*NotifyBind) NewTelegram ¶ added in v0.0.18
func (b *NotifyBind) NewTelegram(text string) *Telegram
func (*NotifyBind) Send ¶
func (b *NotifyBind) Send(msg interface{})
type NotifyConfig ¶
type NotifyConfig struct { MbAccessKey string `json:"mb_access_key"` MbName string `json:"mb_name"` TWFrom string `json:"tw_from"` TWSid string `json:"tw_sid"` TWAuthToken string `json:"tw_auth_token"` TelegramToken string `json:"telegram_token"` TelegramChatId *int64 `json:"telegram_chat_id"` EmailAuth string `json:"email_auth"` EmailPass string `json:"email_pass"` EmailSmtp string `json:"email_smtp"` EmailPort int `json:"email_port"` EmailSender string `json:"email_sender"` SlackToken string `json:"slack_token"` SlackUserName string `json:"slack_user_name"` // contains filtered or unexported fields }
func NewNotifyConfig ¶ added in v0.0.18
func NewNotifyConfig(adaptor *adaptors.Adaptors) *NotifyConfig
func (*NotifyConfig) Get ¶ added in v0.0.18
func (n *NotifyConfig) Get()
func (*NotifyConfig) Update ¶ added in v0.0.18
func (n *NotifyConfig) Update() (err error)
type NotifyStat ¶
type SMS ¶
type SMS struct { Text string `json:"text"` // contains filtered or unexported fields }
func (*SMS) SetRender ¶
func (s *SMS) SetRender(render *m.TemplateRender)
type SlackMessage ¶
func NewSlackMessage ¶
func NewSlackMessage(channel, text string) *SlackMessage
func (*SlackMessage) SetRender ¶
func (s *SlackMessage) SetRender(render *m.TemplateRender)
type Telegram ¶
type Telegram struct {
Text string `json:"text"`
}
func NewTelegram ¶
func (*Telegram) SetRender ¶ added in v0.0.18
func (s *Telegram) SetRender(render *m.TemplateRender)
type TemplateBind ¶
type TemplateBind struct {
// contains filtered or unexported fields
}
Javascript Binding
Template()
.Render('name', {'key':'val'})
func (*TemplateBind) Render ¶
func (t *TemplateBind) Render(templateName string, params map[string]interface{}) *m.TemplateRender
Click to show internal directories.
Click to hide internal directories.