Documentation ¶
Index ¶
- Constants
- func EqMessageType(a, b []database.MessageType) bool
- func GetHomeserverFromUserID(userID string) string
- func GetMatrixLinkForUser(userID string) string
- func GetSuffixInt(value string) (int, error)
- func GetUsernameFromUserIdentifier(userID string) string
- func MinutesToIcalRecurrenceRule(minutes uint64, occurences uint64) string
- func ParseTime(msg string, channel *database.Channel, rawDate bool) (time.Time, error)
- func ReminderToIcalEvent(reminder *database.Reminder) string
- func ReminderToMessage(reminder *database.Reminder) (message, messageHTML string)
- func StripReply(msg string) string
- func StripReplyFormatted(msg string) string
- func TimeToHourAndMinute(t time.Time) string
- func ToLocalTime(datetime time.Time, timezone string) string
- func ToNiceDuration(d time.Duration) string
- type Formater
- func (f *Formater) Bold(text string)
- func (f *Formater) BoldLine(text string)
- func (f *Formater) Build() (message, messageFormatted string)
- func (f *Formater) DoubleNewLine()
- func (f *Formater) Italic(text string)
- func (f *Formater) ItalicLine(text string)
- func (f *Formater) Link(linkText string, url string)
- func (f *Formater) List(items []string)
- func (f *Formater) NewLine()
- func (f *Formater) QuoteLine(text string)
- func (f *Formater) Spoiler(text string)
- func (f *Formater) SubTitle(title string)
- func (f *Formater) Text(text string)
- func (f *Formater) TextLine(text string)
- func (f *Formater) Title(title string)
- func (f *Formater) Username(username string)
Constants ¶
const ( // DateFormatICal is the date format used by iCal DateFormatICal = "20060102T150405Z" // DateFormatDefault is the default date format used by remindme DateFormatDefault = "15:04 02.01.2006 (MST)" )
Variables ¶
This section is empty.
Functions ¶
func EqMessageType ¶
func EqMessageType(a, b []database.MessageType) bool
EqMessageType tests for equality of two message type lists (entries must have same order)
func GetHomeserverFromUserID ¶
GetHomeserverFromUserID returns the homeserver from a user id
func GetMatrixLinkForUser ¶
GetMatrixLinkForUser creates a clickable link pointing to the given user id
func GetSuffixInt ¶
GetSuffixInt returns a suffixed integer in the given string value
func GetUsernameFromUserIdentifier ¶
GetUSerNameFromUserIdentififer extracts the username from the user identifier string. E.g. @testuser:matrix.org will result in testuser
func MinutesToIcalRecurrenceRule ¶
MinutesToIcalRecurrenceRule transfers the given minutes into an iCal recurrence rule https://icalendar.org/iCalendar-RFC-5545/3-8-5-3-recurrence-rule.html
func ParseTime ¶
ParseTime parses the time into the local timezone of a channel. If no timezone is given it defaults to UTC. Days without a time specified default to 9:00
func ReminderToIcalEvent ¶
ReminderToIcalEvent formats a reminder into an iCal event
func ReminderToMessage ¶
func StripReply ¶
StripReply removes the quoted reply from a message
func StripReplyFormatted ¶
StripReplyFormatted removes the quoted reply from a message
func TimeToHourAndMinute ¶
TimeToHourAndMinute converts a time object to an string with the hour and minute in 24h format
func ToLocalTime ¶
ToLocalTime converts the time object to a localized time string
func ToNiceDuration ¶
ToNiceDuration formats a time.Duration into a nice string
Types ¶
type Formater ¶
type Formater struct {
// contains filtered or unexported fields
}
Formater is a string builder with additional formating options
func (*Formater) DoubleNewLine ¶
func (f *Formater) DoubleNewLine()
DoubleNewLine adds two new lines
func (*Formater) ItalicLine ¶
ItalicLine adds italic text