Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var EmptyRoomInfo = RoomInfo{ Members: []RoomMemberProfile{}, }
EmptyRoomInfo is RoomInfo having empty fields rather than nil.
var EmptyRoomMessages = RoomMessages{ Msgs: []Message{}, }
EmptyRoomMessages is RoomMessages having empty fields rather than nil.
var EmptyUnreadRoomMessages = UnreadRoomMessages{ Msgs: []Message{}, }
EmptyUnreadRoomMessages is UnreadRoomMessages having empty fields rather than nil.
var EmptyUserRelation = UserRelation{ Friends: []UserProfile{}, Rooms: []UserRoom{}, }
EmptyUserRelation is UserRelation having empty fields rather than nil.
Functions ¶
This section is empty.
Types ¶
type AuthUser ¶
type AuthUser struct {
ID uint64 `json:"user_id"`
Name string `json:"user_name"`
Password string `json:"password"`
}
AuthUser is a authenticated user information.
type RoomInfo ¶
type RoomInfo struct {
RoomName string `json:"room_name"`
RoomID uint64 `json:"room_id"`
CreatorID uint64 `json:"room_creator_id"`
Members []RoomMemberProfile `json:"room_members"`
MembersSize int `json:"room_members_size"`
}
RoomInfo is a detailed room information. creator
type RoomMemberProfile ¶
type RoomMemberProfile struct {
UserProfile
MessageReadAt time.Time `json:"message_read_at"`
}
RoomMemberProfile is a user profile with room specific information.
type RoomMessages ¶
type RoomMessages struct {
RoomID uint64 `json:"room_id"`
Msgs []Message `json:"messages"`
Cursor struct {
Current time.Time `json:"current"`
Next time.Time `json:"next"`
} `json:"cursor"`
}
RoomMessages is a message list in specified Room.
type UnreadRoomMessages ¶
type UnreadRoomMessages struct {
RoomID uint64 `json:"room_id"`
Msgs []Message `json:"messages"`
MsgsSize int `json:"messages_size"`
}
UnreadRoomMessages is a list of unread messages in specified Room.
type UserProfile ¶
type UserProfile struct {
UserID uint64 `json:"user_id"`
UserName string `json:"user_name"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
}
UserProfile holds information for user profile.
type UserRelation ¶
type UserRelation struct {
UserProfile
Friends []UserProfile `json:"friends"`
Rooms []UserRoom `json:"rooms"`
}
UserRelation is the abstarct information associated with specified User.