notification

package
v0.0.0-...-3ca17b7 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	UserProvider       UserProvider
	ReviseItemProvider ReviseItemProvider
	Notifier           Notifier
}

func NewApplication

func NewApplication(
	userProvider UserProvider,
	reviseItemProvider ReviseItemProvider,
	notifier Notifier,
) Application

func (Application) NotifyUsers

func (a Application) NotifyUsers(ctx context.Context) error

type Notifier

type Notifier interface {
	Notify(ctx context.Context, user domainUser.User, reviseItems []reviseitem.ReviseItem) error
}

type ReviseItemProvider

type ReviseItemProvider interface {
	FetchReviseItemsDueForUser(
		ctx context.Context,
		userID uuid.UUID,
	) ([]reviseitem.ReviseItem, error)
}

type UserProvider

type UserProvider interface {
	// GetUsersForNotification selects users whose notify time is less than now and greater than now - 1 minute.
	GetUsersForNotification(ctx context.Context) ([]domainUser.User, error)
}

UserProvider defines the methods for user data access.

Jump to

Keyboard shortcuts

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