Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FriendList ¶
type FriendList struct {
Users []string `json:"Users"`
}
FriendList - frined string id list
func ParseFriendList ¶
func ParseFriendList(data []byte) (*FriendList, error)
ParseFriendList - parse friend string id list to FriendList object
type Message ¶
type Message struct {
ID string `json:"ID"`
// Before 前一第消息的ID,用来确定是否有消息丢失
Before string `json:"Before"`
// Group 如果当前为群聊,设置为群组ID, 否则为0
Group string `json:"Group"`
// From 发消息的人的ID
From string `json:"From"`
// To 如果当前为私聊,这个设置为收消息用户的ID, 否则为0
To string `json:"To"`
Body string `json:"Body"`
// CreateTime 创建时间
CreateTime string `json:"CreateTime"`
}
type PushMessage ¶
type PushMessage struct {
// 消息类型,如好友,群,通知, 上线,下线之类的操作
Event Event `json:"Event"`
// 关系操作,加好友,删除好友,T出群,加入群
Operate Relation `json:"Operate"`
// 具体消息
Msg Message `json:"Msg"`
// 这消息到底是发给用户的,还是发给群的
ToUser bool `json:"ToUser"`
}
下推的消息,有系统消息(加群,加好友,上线通知啥的),正常聊天消息
func ParsePushMessageList ¶
func ParsePushMessageList(data []byte) ([]*PushMessage, error)
ParsePushMessage - parse PushMessage data
type UserInfo ¶
type UserInfo struct {
ID string `json:"ID"`
Name string `json:"Name"`
NickName string `json:"NickName"`
Avatar string `json:"Avatar"`
Signature string `json:"Signature"`
}
UserInfo - user base info
func ParseUserInfo ¶
ParseUserInfo - parse meta.UserInfo json data to UserInfo object
type UserList ¶
UserList - a list of user, contains user base info
func ParseUserList ¶
ParseUserList - parse meta.UserList json data to UserList object
Click to show internal directories.
Click to hide internal directories.