Documentation ¶
Index ¶
- Constants
- Variables
- func EmailTemplate(box *rice.Box, tmpl string, data interface{}) string
- func InsertDatabase(n *Notification) (int64, error)
- func OnFailure()
- func OnSuccess()
- func SendEmail(box *rice.Box, email *types.Email)
- func SendSlack(msg string) error
- type AllNotifiers
- type Email
- type Notification
- type NotificationForm
- type Notifier
- type Slack
Constants ¶
View Source
const ( EMAIL_ID int64 = 1 EMAIL_METHOD = "email" )
View Source
const ( SLACK_ID = 2 SLACK_METHOD = "slack" )
Variables ¶
View Source
var ( AllCommunications []AllNotifiers Collections db.Collection )
Functions ¶
func EmailTemplate ¶
func InsertDatabase ¶
func InsertDatabase(n *Notification) (int64, error)
Types ¶
type Email ¶
type Email struct { *Notification // contains filtered or unexported fields }
type Notification ¶
type Notification struct { Id int64 `db:"id,omitempty" json:"id"` Method string `db:"method" json:"method"` Host string `db:"host" json:"-"` Port int `db:"port" json:"-"` Username string `db:"username" json:"-"` Password string `db:"password" json:"-"` Var1 string `db:"var1" json:"-"` Var2 string `db:"var2" json:"-"` ApiKey string `db:"api_key" json:"-"` ApiSecret string `db:"api_secret" json:"-"` Enabled bool `db:"enabled" json:"enabled"` Limits int64 `db:"limits" json:"-"` Removable bool `db:"removable" json:"-"` CreatedAt time.Time `db:"created_at" json:"created_at"` Form []NotificationForm Routine chan struct{} }
func Select ¶
func Select(id int64) *Notification
func SelectNotification ¶
func SelectNotification(id int64) (*Notification, error)
func (*Notification) GetValue ¶
func (n *Notification) GetValue(dbField string) string
func (*Notification) Update ¶
func (n *Notification) Update() (*Notification, error)
type NotificationForm ¶
type NotificationForm struct { Type string Title string Placeholder string DbField string // contains filtered or unexported fields }
func (NotificationForm) Value ¶
func (f NotificationForm) Value() string
type Notifier ¶
type Notifier interface { Init() error Install() error Run() error OnFailure() error OnSuccess() error Select() *Notification Test() error }
func SelectNotifier ¶
Click to show internal directories.
Click to hide internal directories.