meta

package
v0.0.0-...-8b7763f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2016 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event int32

Event 事件(消息类型)

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"`
}

func NewMessage

func NewMessage() *Message

NewMessage - create an new Message

func ParseMessage

func ParseMessage(m meta.Message) Message

ParseMessage - parse Message data

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 Relation

type Relation int32

关系

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 NewUserInfo

func NewUserInfo() *UserInfo

NewUserInfo - create an new UserInfo object

func ParseUserInfo

func ParseUserInfo(data []byte) (*UserInfo, error)

ParseUserInfo - parse meta.UserInfo json data to UserInfo object

type UserList

type UserList struct {
	Users []*UserInfo `json:"Users"`
	Count int         `json:"Count"`
}

UserList - a list of user, contains user base info

func NewUserList

func NewUserList(c int) *UserList

NewUserList - create an new UserList object

func ParseUserList

func ParseUserList(data []byte) (*UserList, error)

ParseUserList - parse meta.UserList json data to UserList object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL