notifier

package
v0.0.0-...-23b7d5e Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleProvider

type ArticleProvider interface {
	AllNotPosted(ctx context.Context, since time.Time, limit uint64) ([]model.Article, error)
	MarkAsPosted(ctx context.Context, article model.Article) error
}

type Notifier

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

func New

func New(
	articleProvider ArticleProvider,
	summarizer Summarizer,
	bot *tgbotapi.BotAPI,
	sendInterval time.Duration,
	lookupTimeWindow time.Duration,
	channelID int64,
) *Notifier

func (*Notifier) SelectAndSendArticle

func (n *Notifier) SelectAndSendArticle(ctx context.Context) error

func (*Notifier) Start

func (n *Notifier) Start(ctx context.Context) error

type Summarizer

type Summarizer interface {
	Summarize(text string) (string, error)
}

Jump to

Keyboard shortcuts

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