push

package
v0.0.0-...-66e4c3a Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	Send(token string, title string, message string) ProviderSendResponse
	SendMulticast(tokens []string, title, message string) []ProviderSendResponse
	GetProviderType() ProviderType
}

type ProviderSendResponse

type ProviderSendResponse struct {
	// token the message was sent to
	Token string

	// flag to indicate if the token is still valid
	// not every error means that the token is invalid
	Valid bool

	// ogiginal error
	Err error
}

type ProviderType

type ProviderType string
const (
	ProviderTypeFCM ProviderType = "fcm"
	ProviderTypeAPN ProviderType = "apn"
)

type Service

type Service struct {
	DB *sql.DB
	// contains filtered or unexported fields
}

func New

func New(db *sql.DB) *Service

func (*Service) GetProviderCount

func (s *Service) GetProviderCount() int

func (*Service) RegisterProvider

func (s *Service) RegisterProvider(p Provider)

func (*Service) ResetProviders

func (s *Service) ResetProviders()

func (*Service) SendToUser

func (s *Service) SendToUser(ctx context.Context, user *models.User, title string, message string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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