Documentation ¶
Index ¶
- Variables
- func IsGroupExists(db *db.DB, group GroupID) bool
- func IsUserInGroup(db *db.DB, user UserID, group GroupID) bool
- type Group
- type GroupID
- type InGroup
- type Message
- func (message *Message) GenerateID(seed Timestamp) *Message
- func (message Message) GetGroup() GroupID
- func (message Message) GetID() MessageID
- func (message Message) GetMessage() MessageType
- func (message Message) GetPrevMessageID() MessageID
- func (message Message) GetTime() string
- func (message Message) GetTimestamp() Timestamp
- func (message Message) GetUser() UserID
- func (message *Message) Save()
- func (message *Message) SetPrevID(messageID MessageID) *Message
- func (message *Message) SetTimestamp(timestamp Timestamp) *Message
- func (message Message) Validate() bool
- type MessageID
- type MessageType
- type Timestamp
- type User
- type UserID
Constants ¶
This section is empty.
Variables ¶
View Source
var MessageNil = MessageID("")
Functions ¶
Types ¶
type Group ¶
type Group struct { ID GroupID `json:"id"` Admin UserID `json:"admin"` LastMessage MessageID `json:"last_message"` // contains filtered or unexported fields }
func (Group) GetLastMessage ¶
func (*Group) SetLastMessage ¶
type InGroup ¶
type InGroup struct { User UserID `json:"user"` Group GroupID `json:"group"` LastRead Timestamp `json:"last_read"` // contains filtered or unexported fields }
func (InGroup) GetTimestamp ¶
func (*InGroup) UpdateLastRead ¶
type Message ¶
type Message struct { ID MessageID `json:"id"` Group GroupID `json:"group"` User UserID `json:"user"` Message MessageType `json:"message"` Time string `json:"time"` Timestamp Timestamp `json:"timestamp"` PrevID MessageID `json:"prevID"` // contains filtered or unexported fields }
func CreateNewMessage ¶
func (*Message) GenerateID ¶
func (Message) GetMessage ¶
func (message Message) GetMessage() MessageType
func (Message) GetPrevMessageID ¶
func (Message) GetTimestamp ¶
func (*Message) SetTimestamp ¶
type MessageType ¶
type MessageType string
Click to show internal directories.
Click to hide internal directories.