Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chat ¶
type Chat struct {
// Readers for files to be attached to the next message the client sends in this chat
Attachments []io.Reader
// Data for each message in the chat
// Key (int) - Message ID
// Val (Message) - Message data
Messages map[int]*Message
MessagesBind map[int]binding.String
// Chat metadata
Metadata ChatMetadata
ReplyingTo []int
}
Cache and data for a chat
type ChatCache ¶
type ChatCache struct {
// Cache and data for each loaded chat
// Key (int) - Chat ID
// Val (*Chat) - Chat cache and data
Chats map[int]*Chat
// Cache and data for chat currently shown on screen, is null if there is no chat on screen
ThisChat *Chat
}
func NewChatCache ¶
func NewChatCache() *ChatCache
type ChatMetadata ¶ added in v0.4.0
type ChatMetadata struct {
// A description of what the chat is about
Description string
// ID of the chat
ID int
// Is the chat public?
IsPublic bool
// ID of the last message in the chat. Should be set to -1 and not 0 when creating a chat to prevent and off by 1 error
LastMessageID int
// Usernames of everyone who has access to the chat
Members []string
// The name of the chat
Name string
// Total number of messages in the chat. This should not be updated while the chat is loaded and instead should be calculated from the field `LastMessageID` when saving metadata
NumberOfMessages int
}
Click to show internal directories.
Click to hide internal directories.