Documentation
¶
Overview ¶
Package notifications provides push notification services using SQS for message queuing and delivery.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLoadAWSConfig = errors.ConnectionFailed("AWS config", stdErrors.New("AWS config connection failed")) ErrMarshalPushMessage = errors.MarshalingFailed("push message", stdErrors.New("push message marshaling failed")) ErrQueuePushNotification = errors.ProcessingFailed("push notification queuing", stdErrors.New("failed to queue push notification")) )
Error constants for push notification operations
Functions ¶
func FormatNotificationBody ¶
FormatNotificationBody formats a notification body based on type and content
func FormatNotificationTitle ¶
FormatNotificationTitle formats a notification title based on type
Types ¶
type PushMessage ¶
type PushMessage struct {
Username string `json:"username"`
NotificationType string `json:"notification_type"`
Title string `json:"title"`
Body string `json:"body"`
Icon string `json:"icon,omitempty"`
NotificationID string `json:"notification_id"`
AccessToken string `json:"access_token"`
}
PushMessage represents a push notification message
type PushService ¶
type PushService struct {
// contains filtered or unexported fields
}
PushService handles queuing push notifications
func NewPushService ¶
func NewPushService(cfg *appConfig.Config) (*PushService, error)
NewPushService creates a new push notification service
func (*PushService) QueueNotification ¶
func (s *PushService) QueueNotification(ctx context.Context, msg *PushMessage) error
QueueNotification queues a push notification for delivery
Click to show internal directories.
Click to hide internal directories.