Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Daemon ¶
type Daemon struct { Database Database Messenger asyncmessenger.Messenger }
Daemon holds all information for the reminder daemon
func Create ¶
func Create(db Database, messenger asyncmessenger.Messenger) *Daemon
Create creates a new reminder daemon
func (*Daemon) CheckForDailyReminder ¶
CheckForDailyReminder checks which daily reminder messages needs to be send out and sends them.
type Database ¶
type Database interface { // Message AddMessage(message *database.Message) (*database.Message, error) GetLastMessageByType(msgType database.MessageType, channel *database.Channel) (*database.Message, error) // Reminder GetPendingReminder() ([]database.Reminder, error) GetMessageFromReminder(reminderID uint, msgType database.MessageType) (*database.Message, error) SetReminderDone(*database.Reminder) (*database.Reminder, error) GetDailyReminder(channel *database.Channel) (*[]database.Reminder, error) // Channel GetChannelList() ([]database.Channel, error) }
Database defines a database interface for the reminderdaemon
type Messenger ¶
type Messenger interface { SendReminder(*database.Reminder, *database.Message) (*database.Message, error) SendFormattedMessage(msg, msgFormatted string, channel *database.Channel, msgType database.MessageType, relatedReminderID uint) (resp *mautrix.RespSendEvent, err error) }
Messenger defines a messenger interface for the reminderdaemon
Click to show internal directories.
Click to hide internal directories.