notifier

package
v0.0.0-...-4c96ec7 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 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 BotResponseSender

type BotResponseSender interface {
	SendBotResponse(response sender.BotResponse, opts ...sender.BotResponseOption) error
}

BotResponseSender - bot's response sender.

type Notifier

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

Notifier sends reminders to users.

func New

func New(responseSender BotResponseSender, storage Storage, interval time.Duration) *Notifier

New creates new Notifier.

func (*Notifier) Run

func (n *Notifier) Run(ctx context.Context)

Run starts infinite loop to fetch reminders from Storage and send them to users. Breaks infinite loop on context error.

type Storage

type Storage interface {
	GetPendingReminders(ctx context.Context, limit int64) ([]domain.Reminder, error)
	UpdateReminder(ctx context.Context, reminder domain.Reminder) error
}

Storage - storage interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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