Files
libredesk/internal/ws/models/models.go
T
Abhinav Raut 4bab16c21a feat: user app notification system with bell icon in the sidebar
- notifications for: mention', 'assignment', 'sla_warning', 'sla_breach'
- new table `user_notifications` and migrations for the same.
2026-01-02 01:46:47 +05:30

30 lines
825 B
Go

package models
// Action constants for WebSocket messages.
const (
MessageTypeMessagePropUpdate = "message_prop_update"
MessageTypeConversationPropertyUpdate = "conversation_prop_update"
MessageTypeNewMessage = "new_message"
MessageTypeNewConversation = "new_conversation"
MessageTypeNewNotification = "new_notification"
MessageTypeError = "error"
)
// WSMessage represents a WS message.
type WSMessage struct {
MessageType int
Data []byte
}
// Message represents a WebSocket message to be sent.
type Message struct {
Type string `json:"type"`
Data interface{} `json:"data"`
}
// BroadcastMessage represents a message to be pushed to users.
type BroadcastMessage struct {
Data []byte `json:"data"`
Users []int `json:"users"`
}