Documentation
¶
Index ¶
Constants ¶
View Source
const ( SS_SUCC sendStatus = iota + 1 // 发送成功 SS_NOTONLINE // 不在线 )
View Source
const ( MTP_TEXT msgType = iota + 1 MTP_IMAGE MTP_AUDIO MTP_LOGIN // login MTP_NY_MSG_FAIL // msg not send MTP_NY_MSG_READ // msg read MTP_NY_MSG_SUCC // msg send success MTP_LOGIN_FAIL MTP_LOGIN_SUCC )
View Source
const ( MTO_RSER msgTo = iota + 1 MTO_ROOM )
View Source
const SECRET = "y9p0qRr6Yaf~LBBIv3WEJ6c"
View Source
const SERVER = "golang_chat_bysir"
Variables ¶
This section is empty.
Functions ¶
func VerifyUser ¶
return a user that only set id
Types ¶
type MessageIn ¶
type MessageIn struct { Types msgType `json:"type,emitempty"` // 1 text, 2 image, 3 audio Data string `json:"data,emitempty"` // text or file path To msgTo `json:"to,emitempty"` // 1 user,2 room ToId int64 `json:"to_id,emitempty"` // user id or room id Id int64 `json:"id,emitempty"` // id应该尽量不一样, 用于通知发送了的msg的状态 }
server receive message from user
type MessageOut ¶
type MessageOut struct { Types msgType `json:"type,emitempty"` // 1 text, 2 image, 3 audio FromId int64 `json:"from,emitempty"` // from uid FromPic string `json:"form_pic,emitempty"` // from headPic FromName string `json:"form_name,emitempty"` // from name Timestamp int64 `json:"timestamp,emitempty"` // send time Data string `json:"data,emitempty"` // text or file path Id int64 `json:"id,emitempty"` // 这里的id是发送者发送的id }
server send message to user
func (*MessageOut) Decode ¶
func (p *MessageOut) Decode(d []byte) error
func (*MessageOut) Encode ¶
func (p *MessageOut) Encode() []byte
Click to show internal directories.
Click to hide internal directories.