ctrl

package
v0.0.0-...-6b1d79f Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CMD_SINGLE_MSG = 10
	CMD_ROOM_MSG   = 11
	CMD_HEART      = 0
)

Variables

This section is empty.

Functions

func AddFriend

func AddFriend(w http.ResponseWriter, r *http.Request)

func Chat

func Chat(w http.ResponseWriter, r *http.Request)

ws://127.0.0.1/chat?id=1&token=xxxx

func Community

func Community(w http.ResponseWriter, r *http.Request)

func LoadFriends

func LoadFriends(w http.ResponseWriter, r *http.Request)

func Login

func Login(w http.ResponseWriter, r *http.Request)

测试 curl http://127.0.0.1:8080/user/login -X POST -d "mobile=10000&passwd=111111"

func Register

func Register(w http.ResponseWriter, r *http.Request)

测试 curl http://127.0.0.1:8080/user/register -X POST -d "mobile=10000&passwd=111111"

Types

type Message

type Message struct {
	Id      int64  `json:"id,omitempty" form:"id"`           //消息ID
	Userid  int64  `json:"userid,omitempty" form:"userid"`   //谁发的
	Cmd     int    `json:"cmd,omitempty" form:"cmd"`         //群聊还是私聊
	Dstid   int64  `json:"dstid,omitempty" form:"dstid"`     //对端用户ID/群ID
	Media   int    `json:"media,omitempty" form:"media"`     //消息按照什么样式展示
	Content string `json:"content,omitempty" form:"content"` //消息的内容
	Pic     string `json:"pic,omitempty" form:"pic"`         //预览图片
	Url     string `json:"url,omitempty" form:"url"`         //服务的URL
	Memo    string `json:"memo,omitempty" form:"memo"`       //简单描述
	Amount  int    `json:"amount,omitempty" form:"amount"`   //其他和数字相关的
}

type Node

type Node struct {
	Conn *websocket.Conn
	//并行转串行,
	DataQueue chan []byte
	GroupSets set.Interface
}

本核心在于形成userid和Node的映射关系

Jump to

Keyboard shortcuts

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