notification

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	ChatID      int64
	NewInterval time.Duration
}

type Manager

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

func NewManager

func NewManager(
	clientManager *client.Manager,
	store *storage.Storage,
	updateCh chan SchedulerUpdate,
	notificationCh chan Notification,
) *Manager

func (*Manager) AddScheduler

func (m *Manager) AddScheduler(
	chatID int64,
	interval time.Duration,
) error

func (*Manager) RemoveScheduler

func (m *Manager) RemoveScheduler(chatID int64)

func (*Manager) StopAll

func (m *Manager) StopAll()

func (*Manager) WatchForSchedulerUpdates added in v0.0.3

func (m *Manager) WatchForSchedulerUpdates()

type Notification

type Notification struct {
	ChatID  int64
	Message string
	Updates []Update
}

type Scheduler

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

func NewScheduler

func NewScheduler(interval time.Duration) *Scheduler

func (*Scheduler) Start

func (s *Scheduler) Start(
	chatID int64,
	notificationCh chan Notification,
	client *client.Client,
	store *storage.Storage,
)

func (*Scheduler) Stop

func (s *Scheduler) Stop()

func (*Scheduler) UpdateInterval

func (s *Scheduler) UpdateInterval(
	chatID int64,
	newInterval time.Duration,
)

type SchedulerUpdate added in v0.0.3

type SchedulerUpdate struct {
	ChatID   int64
	Interval time.Duration
}

type Update

type Update struct {
	TitleID           int64
	LatestTimestamp   int64
	Name              string
	NewFileEntryNames []string
}

Jump to

Keyboard shortcuts

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