notifications

package
v1.1.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

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

func FormatNotificationBody(notificationType string, content string) string

FormatNotificationBody formats a notification body based on type and content

func FormatNotificationTitle

func FormatNotificationTitle(notificationType string, actorName string) string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL