notifications

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ActivityBuffer time.Duration
	ScanInterval   time.Duration
	WorkersCount   int
}

type Dependencies added in v0.3.7

type Dependencies struct {
	Storage         Storage
	Game            GameService
	SandboxNotifier Notifier
	ProdNotifier    Notifier
}

type GameService

type GameService interface {
	GetUserGames(ctx context.Context, userId string) ([]*game.UserGame, error)
}

type Notifier

type Notifier interface {
	SendNotification(ctx context.Context, device []byte, n apn.Notification) error
}

type Service

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

func NewService

func NewService(cfg Config, deps Dependencies) *Service

func (*Service) NotifyUser

func (s *Service) NotifyUser(ctx context.Context, userId string) error

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

type Storage

type Storage interface {
	GetActiveUsers(ctx context.Context, activityBuffer time.Duration) ([]string, error)
	GetUserById(ctx context.Context, userId string) (*storage.User, error)
	UpdateSentNotification(ctx context.Context, userId string, updater storage.SentNotificationUpdater) error
}

Jump to

Keyboard shortcuts

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