Debian Codegraph @

webpush/types.go

raw
1 package webpush
2
3 import "heckel.io/ntfy/v2/log"
4
5 // Subscription represents a web push subscription.
6 type Subscription struct {
7 ID string
8 Endpoint string
9 Auth string
10 P256dh string
11 UserID string
12 }
13
14 // Context returns the logging context for the subscription.
15 func (w *Subscription) Context() log.Context {
16 return map[string]any{
17 "web_push_subscription_id": w.ID,
18 "web_push_subscription_user_id": w.UserID,
19 "web_push_subscription_endpoint": w.Endpoint,
20 }
21 }