ntfy

package
v0.139.0 Latest Latest
Warning

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

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

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

func New(topic, token, events string) *Client

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 (*Client) SendAttention

func (c *Client) SendAttention(sessionID, agent, cwd, clickURL string)

SendAttention sends a "needs input" notification synchronously. Caller is responsible for running in a goroutine if fire-and-forget is desired.

func (*Client) SendExit

func (c *Client) SendExit(sessionID, agent, cwd string, exitCode int, clickURL string)

SendExit sends a session exit notification synchronously. Caller is responsible for running in a goroutine if fire-and-forget is desired.

func (*Client) SendTest

func (c *Client) SendTest() error

SendTest sends a test notification synchronously and returns any error.

Jump to

Keyboard shortcuts

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