Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BroadCastConfig ¶
type BroadCastConfig struct { // DB is used to query users to broadcast DB *gorm.DB // MemDB is used to store chat id MemDB *buntdb.DB // WorkerCount is used in concurrent broadcast WorkerCount int // FeedChannel is where feed item comes from FeedChannel <-chan *models.Feed // Bot is the bot which broadcaster broadcast to Bot *telebot.Bot // Logger is used to log events Logger log.Logger // Template is a string used to render text Template string // Telegraph is the config of telegraph module Telegraph *telegraph.Config }
BroadCastConfig is used to config a broadcaster
type BroadCaster ¶
type BroadCaster interface { Start() Stop() }
BroadCaster receive item from channel and broadcast it to any user subscribe to it
func NewBroadcaster ¶
func NewBroadcaster(c *BroadCastConfig) (BroadCaster, error)
NewBroadcaster generates new Broadcaster instance from config
type Poller ¶
type Poller interface { Start() error Stop() error AddSource(s *models.Source) error RemoveSource(s *models.Source) error FetchTitle(url string) (string, error) }
Poller get feed item from source and send it into feedChannel if it is new
func NewPoller ¶
func NewPoller(c *PollerConfig) (Poller, error)
NewPoller creates a Poller according to the Config
Click to show internal directories.
Click to hide internal directories.