watchlist

package
v0.26.10 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HMACSecret

func HMACSecret() string

HMACSecret returns the DIGEST_HMAC_SECRET env var used for unsubscribe tokens.

func RenderDigest

func RenderDigest(events []postgres.NotificationEvent, baseURL, unsubURL string) (htmlBody, textBody string)

RenderDigest produces HTML and plain-text bodies for a weekly digest email. Events are pre-sorted by created_at DESC and capped at the caller's limit. unsubURL is the HMAC-signed one-click unsubscribe URL (may be empty if secret is not configured).

func UnsubscribeToken

func UnsubscribeToken(secret, tenantID string) string

UnsubscribeToken generates an HMAC-SHA256 token for one-click unsubscribe.

func ValidateUnsubscribeToken

func ValidateUnsubscribeToken(secret, tenantID, token string) bool

ValidateUnsubscribeToken checks an unsubscribe token using constant-time comparison.

Types

This section is empty.

Jump to

Keyboard shortcuts

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