Documentation ¶
Index ¶
- type Action
- type ActionArgument
- type ChannelInterface
- type Config
- type Message
- type Notification
- func (notification *Notification) Action(action *Action) error
- func (notification *Notification) ConfigureQorResource(res resource.Resourcer)
- func (notification *Notification) GetAction(name string) *Action
- func (notification *Notification) GetNotification(user interface{}, messageID string, context *qor.Context) *QorNotification
- func (notification *Notification) GetNotifications(user interface{}, context *qor.Context) *NotificationsResult
- func (notification *Notification) GetUnresolvedNotificationsCount(user interface{}, context *qor.Context) uint
- func (notification *Notification) RegisterChannel(channel ChannelInterface)
- func (notification *Notification) Send(message *Message, context *qor.Context) error
- type NotificationsResult
- type QorNotification
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { Name string Label string Method string MessageTypes []string Resource *admin.Resource Visible func(data *QorNotification, context *admin.Context) bool URL func(data *QorNotification, context *admin.Context) string Handler func(actionArgument *ActionArgument) error Undo func(actionArgument *ActionArgument) error FlashMessage func(actionArgument *ActionArgument, succeed bool, isUndo bool) string }
func (Action) HasMessageType ¶
type ActionArgument ¶
type ActionArgument struct { Message *QorNotification Context *admin.Context Argument interface{} }
type ChannelInterface ¶
type ChannelInterface interface { Send(message *Message, context *qor.Context) error GetNotifications(user interface{}, results *NotificationsResult, notification *Notification, context *qor.Context) error GetUnresolvedNotificationsCount(user interface{}, notification *Notification, context *qor.Context) uint GetNotification(user interface{}, notificationID string, notification *Notification, context *qor.Context) (*QorNotification, error) }
type Notification ¶
type Notification struct { Config *Config Channels []ChannelInterface Actions []*Action }
func New ¶
func New(config *Config) *Notification
func (*Notification) Action ¶
func (notification *Notification) Action(action *Action) error
func (*Notification) ConfigureQorResource ¶
func (notification *Notification) ConfigureQorResource(res resource.Resourcer)
func (*Notification) GetAction ¶
func (notification *Notification) GetAction(name string) *Action
func (*Notification) GetNotification ¶
func (notification *Notification) GetNotification(user interface{}, messageID string, context *qor.Context) *QorNotification
func (*Notification) GetNotifications ¶
func (notification *Notification) GetNotifications(user interface{}, context *qor.Context) *NotificationsResult
func (*Notification) GetUnresolvedNotificationsCount ¶
func (notification *Notification) GetUnresolvedNotificationsCount(user interface{}, context *qor.Context) uint
func (*Notification) RegisterChannel ¶
func (notification *Notification) RegisterChannel(channel ChannelInterface)
type NotificationsResult ¶
type NotificationsResult struct { Notification *Notification Notifications []*QorNotification Resolved []*QorNotification }
type QorNotification ¶
type QorNotification struct { gorm.Model From string To string Title string Body string `sql:"size:65532"` MessageType string ResolvedAt *time.Time }
func (*QorNotification) Actions ¶
func (qorNotification *QorNotification) Actions(context *admin.Context) (actions []*Action)
func (QorNotification) IsResolved ¶
func (qorNotification QorNotification) IsResolved() bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.