Documentation ¶
Index ¶
Constants ¶
View Source
const ( KChatCreateGroup = Event(iota) //创建群 KChatJoinGroup //进群 KChatLeaveGroup //退群 KChatRemoveGroup //解散群 KChatMessage //发消息 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group interface { Chat GetGroupKey(appId string, plat int32, groupId int64) string GetGroupVersion(groupId int64, key string) int64 UpdateGroupVersion(groupId int64, key string, version int64) error // InGroups 加过哪些群组 InGroups(userId MemberId) ([]GroupUser, error) JoinGroup(groupId int64, key string, member *Member) error LeaveGroup(groupId int64, key string, memberId MemberId) error RemoveGroup(groupId int64, key string) error GroupMemberCount(groupId int64, key string) (int64, error) GetGroupMember(groupId int64, key string) ([]*Member, error) }
type GroupModel ¶
type Message ¶
type Message struct { // 消息的来源ID(如果是私聊,则是接收用户id,如果是群聊,则是群组id) Id int64 `json:"id"` FromId MemberId `json:"fromid"` // 消息的发送者id ToId MemberId `json:"toid"` // 接收者id Content string `json:"content"` // 消息 Type string `json:"type"` // "group", "friend",聊天类型 Avatar string `json:"avatar"` //消息来源用户头像 UserName string `json:"username"` //消息来源用户名 Mine bool `json:"mine"` //是否我发送的消息,如果为true,则会显示在右方 }
type Package ¶
func (*Package) ToChatGroup ¶
func (pack *Package) ToChatGroup() *GroupModel
Click to show internal directories.
Click to hide internal directories.