Documentation
¶
Index ¶
Constants ¶
View Source
const (
EventLogin = "login"
)
View Source
const (
TopicSendMessage = "topic.notify.send_message"
)
View Source
const (
TypeEmail = "email"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController() *Controller
func (*Controller) RegisterRoute ¶
func (c *Controller) RegisterRoute(group *gin.RouterGroup)
type EmailNotifier ¶
type EmailNotifier struct {
// contains filtered or unexported fields
}
func NewEmailNotifier ¶
func NewEmailNotifier(conf config.Email) *EmailNotifier
func (*EmailNotifier) Send ¶
func (n *EmailNotifier) Send(ctx context.Context, msg *MessageTemplate) error
type MessageReceiver ¶
type MessageTemplate ¶
type MessageTemplate struct {
ID uuid.UUID `json:"id" gorm:"primary_key;type:uuid;"`
Event string `json:"event" gorm:"not null;"`
Subject string `json:"subject" gorm:"not null;"`
Body string `json:"body" gorm:"not null;"`
Level string `json:"level" gorm:"not null;"`
DefaultSubject string `json:"defaultSubject" gorm:"not null;"`
DefaultBody string `json:"defaultBody" gorm:"not null;"`
Receivers MessageReceiver `json:"-" gorm:"-"`
database.BaseModel
}
func (*MessageTemplate) BeforeCreate ¶
func (m *MessageTemplate) BeforeCreate(tx *gorm.DB) error
func (*MessageTemplate) TableName ¶
func (m *MessageTemplate) TableName() string
type NotifierManager ¶
type NotifierManager struct {
// contains filtered or unexported fields
}
func GetNotifierManager ¶
func GetNotifierManager() *NotifierManager
func (*NotifierManager) AddNotifier ¶
func (nm *NotifierManager) AddNotifier(name string, notifier Notifier)
func (*NotifierManager) GetNotifier ¶
func (nm *NotifierManager) GetNotifier(name string) Notifier
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func GetService ¶
func GetService() *Service
func (*Service) Initialize ¶
Click to show internal directories.
Click to hide internal directories.