notifications

package
v1.6.29 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: AGPL-3.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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