push

package
v0.0.0-...-7e2b890 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package push delivers Web Push notifications to a user's devices when they're away (no live SSE stream), so @mentions and DMs reach them even with Hermes closed. Connected clients keep using the in-page Notification path instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

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

Notifier decides, per ingested message, which away users to Web Push.

func NewNotifier

func NewNotifier(st store, pr presence, sender *Sender, log *slog.Logger) *Notifier

func (*Notifier) Consider

func (n *Notifier) Consider(e irc.Event)

Consider inspects an emitted event and, off the hot path, Web Pushes the away recipients for whom it's a DM or an @mention.

type Sender

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

Sender encrypts and posts Web Push messages to push services using VAPID.

func NewSender

func NewSender(public, private, contact string) *Sender

func (*Sender) Send

func (s *Sender) Send(ctx context.Context, sub data.PushSub, payload []byte) (status int, body string, err error)

Send delivers payload to one subscription, returning the push service's HTTP status and (on a non-2xx) the response body for diagnostics.

Jump to

Keyboard shortcuts

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