notification

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hub

type Hub struct {
	// contains filtered or unexported fields
}

Hub manages notification delivery in the Mana framework.

func NewHub

func NewHub(logger Logger) *Hub

NewHub creates a new notification Hub.

func (*Hub) Broadcast

func (h *Hub) Broadcast(ctx context.Context, n core.Notification)

Broadcast sends a notification to all online users.

func (*Hub) Register

func (h *Hub) Register(userID, sessionID string, conn ws.Conn)

Register adds a user connection to the notification registry.

func (*Hub) Send

func (h *Hub) Send(ctx context.Context, userID string, n core.Notification) error

Send delivers a notification to a specific user.

func (*Hub) Unregister

func (h *Hub) Unregister(userID, sessionID string)

Unregister removes a user from the notification registry.

type Logger

type Logger interface {
	Info(format string, args ...interface{})
	Error(format string, args ...interface{})
}

Logger interface for the notification hub.

Jump to

Keyboard shortcuts

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