push

package
v0.44.45 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

(Web)Push notifications and subscriptions routes and controllers logic package for the backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSubscriptionByID added in v0.44.32

func GetSubscriptionByID(userID string, cache db.Cacher) (*[]models.Device, error)

GetSubscriptionByID is a static function to export to other services.

func NewSubscriptionRepository added in v0.44.32

func NewSubscriptionRepository(cache db.Cacher) models.SubscriptionRepositoryInterface

func Router

func Router() chi.Router

func SendNotificationToDevices

func SendNotificationToDevices(opts *NotificationOpts)

Types

type NotificationOpts added in v0.43.0

type NotificationOpts struct {
	Receiver string
	Devices  *[]models.Device
	Body     *[]byte
}

type SubscriptionRepository added in v0.44.32

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

The implementation of pkg/models.SubscriptionRepositoryInterface.

func (*SubscriptionRepository) Delete added in v0.44.32

func (r *SubscriptionRepository) Delete(userID string) error

func (*SubscriptionRepository) GetByID added in v0.44.32

func (r *SubscriptionRepository) GetByID(userID string) (*[]models.Device, error)

func (*SubscriptionRepository) Save added in v0.44.32

func (r *SubscriptionRepository) Save(userID string, subscription *[]models.Device) error

Jump to

Keyboard shortcuts

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