Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTopic ¶
func GenerateTopic() string
GenerateTopic returns a random ntfy topic like "wing-apple-brave-coral-drift" using 4 random words from the BIP39 wordlist joined by hyphens with a "wing-" prefix.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client sends push notifications via ntfy.sh (or a self-hosted ntfy server).
func New ¶
New creates a new ntfy client. Topic can be a bare topic name (expanded to https://ntfy.sh/{topic}) or a full URL (https://ntfy.example.com/mytopic). Events is a comma-separated list of event types to send (e.g. "attention,exit").
func NewHosted ¶ added in v0.145.0
NewHosted creates a client suitable for a multi-tenant hosted relay. It requires public HTTPS destinations, refuses redirects to unsafe endpoints, and resolves/dials only public IPs so notification configuration cannot be used to reach loopback, metadata, or private services. Operator-controlled local and roost deployments may continue to use New for private ntfy servers.
func (*Client) SendAttention ¶
SendAttention sends a "needs input" notification synchronously. Caller is responsible for running in a goroutine if fire-and-forget is desired.