Documentation
¶
Index ¶
- type Dispatcher
- type NotificationAction
- type NotificationPayload
- type Sender
- type Server
- func (s *Server) GetVapidPublicKey(_ context.Context, _ *connect.Request[taskguildv1.GetVapidPublicKeyRequest]) (*connect.Response[taskguildv1.GetVapidPublicKeyResponse], error)
- func (s *Server) RegisterPushSubscription(ctx context.Context, ...) (*connect.Response[taskguildv1.RegisterPushSubscriptionResponse], error)
- func (s *Server) SendTestNotification(ctx context.Context, ...) (*connect.Response[taskguildv1.SendTestNotificationResponse], error)
- func (s *Server) UnregisterPushSubscription(ctx context.Context, ...) (*connect.Response[taskguildv1.UnregisterPushSubscriptionResponse], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(eventBus *eventbus.Bus, interactionRepo interaction.Repository, taskRepo task.Repository, sender *Sender, baseEnv *config.BaseEnv) *Dispatcher
func (*Dispatcher) Start ¶
func (d *Dispatcher) Start(ctx context.Context)
type NotificationAction ¶ added in v0.0.2
type NotificationAction struct {
Action string `json:"action"`
Title string `json:"title"`
Type string `json:"type,omitempty"` // "button" (default) or "text" (inline reply)
}
NotificationAction represents an action button on the push notification. On supported platforms (Chrome Android), these render as buttons the user can tap without opening the app.
type NotificationPayload ¶
type NotificationPayload struct {
Title string `json:"title"`
Body string `json:"body"`
URL string `json:"url,omitempty"`
Tag string `json:"tag,omitempty"`
// Enhanced fields for notification action support.
InteractionID string `json:"interactionId,omitempty"`
ResponseToken string `json:"responseToken,omitempty"`
APIBaseURL string `json:"apiBaseUrl,omitempty"`
Type string `json:"type,omitempty"` // "permission_request" or "question"
Actions []NotificationAction `json:"actions,omitempty"`
}
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
func NewSender ¶
func NewSender(vapidEnv *config.VAPIDEnv, repo pushsubscription.Repository) *Sender
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(vapidEnv *config.VAPIDEnv, repo pushsubscription.Repository, sender *Sender) *Server
func (*Server) GetVapidPublicKey ¶
func (s *Server) GetVapidPublicKey(_ context.Context, _ *connect.Request[taskguildv1.GetVapidPublicKeyRequest]) (*connect.Response[taskguildv1.GetVapidPublicKeyResponse], error)
func (*Server) RegisterPushSubscription ¶
func (s *Server) RegisterPushSubscription(ctx context.Context, req *connect.Request[taskguildv1.RegisterPushSubscriptionRequest]) (*connect.Response[taskguildv1.RegisterPushSubscriptionResponse], error)
func (*Server) SendTestNotification ¶
func (s *Server) SendTestNotification(ctx context.Context, _ *connect.Request[taskguildv1.SendTestNotificationRequest]) (*connect.Response[taskguildv1.SendTestNotificationResponse], error)
func (*Server) UnregisterPushSubscription ¶
func (s *Server) UnregisterPushSubscription(ctx context.Context, req *connect.Request[taskguildv1.UnregisterPushSubscriptionRequest]) (*connect.Response[taskguildv1.UnregisterPushSubscriptionResponse], error)
Click to show internal directories.
Click to hide internal directories.