structs

package
v0.0.0-...-2942fcd Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MSG_VERSION = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Module string `json:"module"`
	// 协议版本号
	Version int `json:"varsion"`
	// 消息唯一id
	UUID int
	// 消息来源用户id
	UID string
	// 消息类型 GROUP PRIVATE SYSTEM
	Type string `json:"type"`
	// 目标id : ueser_id || group_id
	Target string `json:"target"`
	// 消息发送时间
	Time    int `json:"time"`
	Content MessageContent
}

消息结构

func MessageNotice

func MessageNotice(uid string, target string, msg string) *Message

func OfflineNotice

func OfflineNotice(uid string, target string, user *UserInfo) *Message

下线通知

func OnlineNotice

func OnlineNotice(uid string, target string, user *UserInfo) *Message

上线通知

type MessageContent

type MessageContent struct {
	Type string
	Data string
}

消息内容结构

type UserInfo

type UserInfo struct {
	UID      int
	UserName string        `bson:"username"`
	Email    string        `bson:"email"`
	ID       bson.ObjectId `bson:"_id"`
	Passwd   string        `bson:"passwd"`
}

用户的资料信息结构

Jump to

Keyboard shortcuts

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