Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateInfoText ¶
func GenerateInfoText(botInfo AlertMessage) string
GenerateInfoText generates a formatted issue text, should be visible on any client that supports markdown and HTML.
Types ¶
type AlertMessage ¶
type AlertMessage struct { // User defined infos (need sanitization) PhoneNumber string Email string Categories string Comment string Name string // Generated infos CourseName string LectureHall string StreamUrl string CombIP string CameraIP string IsLecturer bool Stream model.Stream User model.User }
AlertMessage contains all information that is needed for a debugging message. This should later be extended with a custom message field that can be filled on the stream page.
type Bot ¶
type Bot struct {
Method MessageProvider
}
Bot is the bot that will be used to send messages to the chat.
func (*Bot) SendAlert ¶
func (b *Bot) SendAlert(alert AlertMessage, statsDao dao.StatisticsDao) error
SendAlert sends an alert message to the bot e.g. via Matrix.
func (*Bot) SendMessage ¶
SendMessage sends a message via the bot that abstracts the provider.
func (*Bot) SetMessagingMethod ¶
func (b *Bot) SetMessagingMethod(method MessageProvider)
SetMessagingMethod sets the provider method for sending messages e.g. Matrix
type Matrix ¶
type Matrix struct { }
Matrix strategy
func (*Matrix) SendBotMessage ¶
SendBotMessage sends a formatted message to a matrix room with id roomID.
type Message ¶
type Message struct { Text string Prio bool ProviderMethod MessageProvider }
Message is a generic message that will be forwarded via the implementation specified via ProviderMethod.
type MessageProvider ¶
MessageProvider provides a generic interface for different message providers e.g. Matrix