Documentation
¶
Overview ¶
Package push delivers Web Push notifications straight from this machine to the browsers paired with it — no third party in the middle. A VAPID keypair (generated once, kept under ~/.cuxdeck) identifies this deck to the browsers' push services; subscriptions are stored locally and keyed by device token, so revoking a device silences it. Payloads are the same small JSON the service worker renders as a notification.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
Event is re-exported from notify so callers can keep using push.Event while the watcher speaks the shared type.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store holds the VAPID keys and the live subscriptions.
func (*Store) Has ¶
Has reports whether any subscriptions exist (so the watcher can skip work when nobody's listening).
func (*Store) Notify ¶
Notify sends ev to every subscription. Subscriptions the push service reports as gone (404/410) are pruned.
func (*Store) Subscribe ¶
func (s *Store) Subscribe(device string, w *webpush.Subscription)
Subscribe records (or refreshes) a browser subscription for a device. A device replaces its own prior subscription so re-enabling doesn't pile up duplicates.
func (*Store) Unsubscribe ¶
Unsubscribe drops every subscription owned by a device (called on device revoke and on explicit disable).