Documentation
¶
Overview ¶
Package model provides the domain-specific data models for this list.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DateBoundary ¶
DateBoundary represents a change in the date during a chat.
func (DateBoundary) Serial ¶
func (d DateBoundary) Serial() list.Serial
Serial returns the unique identifier of the message.
type Message ¶
type Message struct {
SerialID string
Sender, Content, Status string
SentAt time.Time
Image string
Avatar string
Read bool
}
Message represents a chat message.
type Room ¶
type Room struct {
// Image avatar for the room.
Image image.Image
// Name of the room.
Name string
// Latest message in the room, if any.
Latest *Message
// Composing is a set of users in this room currently composing a message.
Composing sync.Map
}
Room is a unique conversation context. Room can have any number of participants, and any number of messages. Any participant of a room should be able to view the room, send messages to and recieve messages from the other participants.
func (*Room) SetComposing ¶
SetComposing sets the composing status of a user for this room.
type Rooms ¶
type Rooms struct {
// contains filtered or unexported fields
}
Rooms structure manages a collection of rooms.
type UnreadBoundary ¶
type UnreadBoundary struct{}
UnreadBoundary represents the boundary between the last read message in a chat and the next unread message.
func (UnreadBoundary) Serial ¶
func (u UnreadBoundary) Serial() list.Serial
Serial returns the unique identifier for the boundary.
type User ¶
type User struct {
// Name of user.
Name string
// Avatar is url to the image of the user.
Avatar string
// Theme specifies the name of a 9patch theme to use for messages from this
// user. If theme is specified it will be the preferred message surface.
// Empty string indicates no theme.
Theme Theme
// Color to use for message bubbles of messages from this user.
Color color.NRGBA
}
User is a unique identity that can send messages and participate in rooms.