webpush

package
v0.1.33 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotificationAction

type NotificationAction struct {
	Action string `json:"action"`
	Title  string `json:"title"`
}

type NotificationPayload

type NotificationPayload struct {
	Title   string                 `json:"title"`
	Body    string                 `json:"body"`
	Icon    string                 `json:"icon,omitempty"`
	Badge   string                 `json:"badge,omitempty"`
	Tag     string                 `json:"tag,omitempty"`
	Data    map[string]interface{} `json:"data,omitempty"`
	Actions []NotificationAction   `json:"actions,omitempty"`
}

NotificationPayload matches the structure expected by the SW

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(store *store.Store, publicKey, privateKey, subject, adminEmail, domain string) *Service

func (*Service) SendBPReminderNotification

func (s *Service) SendBPReminderNotification(ctx context.Context, userID int64, enhanced bool) error

func (*Service) SendEarlyIntakeConfirmation

func (s *Service) SendEarlyIntakeConfirmation(ctx context.Context, userID int64, meds []store.Medication, scheduledTime, takenTime time.Time, intakeIDs []int64) error

SendEarlyIntakeConfirmation sends a confirmation notification when user takes medication early

func (*Service) SendLowStockNotification

func (s *Service) SendLowStockNotification(ctx context.Context, userID int64, meds []store.Medication) error

func (*Service) SendMedicationNotification

func (s *Service) SendMedicationNotification(ctx context.Context, userID int64, meds []store.Medication, scheduledTime time.Time, intakeIDs []int64) error

func (*Service) SendWeightReminderNotification

func (s *Service) SendWeightReminderNotification(ctx context.Context, userID int64) error

SendWeightReminderNotification sends a weight reminder notification via Web Push

func (*Service) SendWorkoutNotification

func (s *Service) SendWorkoutNotification(ctx context.Context, userID int64, session *store.WorkoutSession, group *store.WorkoutGroup, variant *store.WorkoutVariant) error

Jump to

Keyboard shortcuts

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