Documentation ¶
Index ¶
- Constants
- func DecodeMsg(data []byte, pmsg *GeneralMsg) error
- func EncodeMsg(pmsg *GeneralMsg) ([]byte, error)
- func Proto2Msg(proto_id int) (interface{}, error)
- type CSApplyGroupAudit
- type CSApplyGroupNotify
- type CSApplyGroupReq
- type CSApplyGroupRsp
- type CSChatHistoryReq
- type CSChgGroupAttrReq
- type CSChgGroupAttrRsp
- type CSCommonNotify
- type CSCommonQuery
- type CSCreateGroupReq
- type CSCreateGroupRsp
- type CSExitGroupReq
- type CSExitGroupRsp
- type CSFetchUserProfileReq
- type CSFetchUserProfileRsp
- type CSGroupGroundReq
- type CSGroupGroundRsp
- type CSKickGroupReq
- type CSLoginReq
- type CSLoginRsp
- type CSLogoutReq
- type CSLogoutRsp
- type CSPingReq
- type CSPingRsp
- type CSQueryGroupReq
- type CSRegReq
- type CSRegRsp
- type CSSendChatReq
- type CSSendChatRsp
- type CSSyncChatList
- type CSSyncGroupInfo
- type CSUpdateChatReq
- type CSUpdateChatRsp
- type CSUpdateUserReq
- type CSUpdateUserRsp
- type ChatGroup
- type ChatMsg
- type GeneralMsg
- type GroupGroundItem
- type ProtoHead
- type UserBasic
- type UserChatGroup
- type UserChatInfo
- type UserDetail
- type UserProfile
Constants ¶
View Source
const ( //proto start CS_PROTO_START = 0 CS_PROTO_PING_REQ = 1 CS_PROTO_PING_RSP = 2 CS_PROTO_LOGIN_REQ = 3 CS_PROTO_LOGIN_RSP = 4 CS_PROTO_LOGOUT_REQ = 5 CS_PROTO_LOGOUT_RSP = 6 CS_PROTO_REG_REQ = 7 CS_PROTO_REG_RSP = 8 CS_PROTO_CREATE_GRP_REQ = 9 CS_PROTO_CREATE_GRP_RSP = 10 CS_PROTO_APPLY_GRP_REQ = 11 CS_PROTO_APPLY_GRP_RSP = 12 CS_PROTO_APPLY_GRP_NOTIFY = 13 CS_PROTO_APPLY_GRP_AUDIT = 14 CS_PROTO_SEND_CHAT_REQ = 15 CS_PROTO_SEND_CHAT_RSP = 16 CS_PROTO_SYNC_CHAT_LIST = 17 CS_PROTO_EXIT_GROUP_REQ = 18 CS_PROTO_EXIT_GROUP_RSP = 19 CS_PROTO_CHAT_HISTORY_REQ = 20 CS_PROTO_COMMON_NOTIFY = 21 CS_PROTO_KICK_GROUP_REQ = 22 CS_PROTO_QUERY_GROUP_REQ = 23 CS_PROTO_SYNC_GROUP_INFO = 24 CS_PROTO_FETCH_USER_PROFILE_REQ = 25 CS_PROTO_FETCH_USER_PROFILE_RSP = 26 CS_PROTO_CHG_GROUP_ATTR_REQ = 27 CS_PROTO_CHG_GROUP_ATTR_RSP = 28 CS_PROTO_GROUP_GROUND_REQ = 29 CS_PROTO_GROUP_GROUND_RSP = 30 CS_PROTO_COMMON_QUERY = 31 CS_PROTO_UPDATE_USER_REQ = 32 CS_PROTO_UPDATE_USER_RSP = 33 CS_PROTO_UPDATE_CHAT_REQ = 34 CS_PROTO_UPDATE_CHAT_RSP = 35 //PS:new proto added should modify 'Proto2Msg' function //proto end = last + 1 CS_PROTO_END = 36 )
CS PROTO ID
View Source
const ( COMMON_RESULT_SUCCESS = 0 COMMON_RESULT_FAILED = 1 //COMMON_NOTIFY_TYPE COMMON_NOTIFY_T_FILE_ADDR = 1 COMMON_NOTIFY_T_ADD_MEM = 2 COMMON_NOTIFY_T_DEL_MEM = 3 COMMON_NOTIFY_T_HEAD_URL = 4 COMMON_NOTIFY_T_ENTER_GROUP = 5 //self enter group COMMON_NOTIFY_T_SERVER_SETTING = 6 //server setting //COMMON_QUERY_TYPE COMMON_QUERY_OWN_GRP_SNAP = 0 COMMON_QUERY_SET_CLI_HEART = 1 )
View Source
const ( CHAT_MSG_TYPE_TEXT = 0 CHAT_MSG_TYPE_IMG = 1 //sync group field SYNC_GROUP_FIELD_ALL = 1 SYNC_GROUP_FIELD_SNAP = 2 //group attr GROUP_ATTR_VISIBLE = 0 GROUP_ATTR_INVISIBLE = 1 GROUP_ATTR_DESC = 2 GROUP_ATTR_GRP_NAME = 3 GROUP_ATTR_GRP_HEAD = 4 )
View Source
const ( SEX_MALE = 1 SEX_FEMALE = 2 )
Variables ¶
This section is empty.
Functions ¶
func EncodeMsg ¶
func EncodeMsg(pmsg *GeneralMsg) ([]byte, error)
* Encode GeneralMsg * @return encoded_bytes , error
Types ¶
type CSApplyGroupAudit ¶
type CSApplyGroupNotify ¶
type CSApplyGroupReq ¶
type CSApplyGroupReq struct { GrpId int64 `json:"grp_id"` GrpName string `json:"grp_name"` Pass string `json:"pass"` Msg string `json:"msg"` }
apply group
type CSApplyGroupRsp ¶
type CSChatHistoryReq ¶
type CSChgGroupAttrReq ¶
type CSChgGroupAttrRsp ¶
type CSCommonNotify ¶
type CSCommonNotify struct { NotifyType int `json:"type"` //refer COMMON_NOTIFY_T_XX GrpId int64 `json:"grp_id"` IntV int64 `json:"intv"` StrV string `json:"strv"` StrS []string `json:"strs"` }
server --> client common notify
type CSCommonQuery ¶
type CSCommonQuery struct { QueryType int `json:"type"` GrpId int64 `json:"grp_id"` IntV int64 `json:"int_v"` StrV string `json:"str_v"` }
client --> server common query
type CSCreateGroupReq ¶
type CSCreateGroupReq struct { Name string `json:"name"` Pass string `json:"pass"` Desc string `json:"desc"` }
create group
type CSCreateGroupRsp ¶
type CSExitGroupReq ¶
type CSExitGroupReq struct {
GrpId int64 `json:"grp_id"`
}
type CSExitGroupRsp ¶
type CSFetchUserProfileReq ¶
type CSFetchUserProfileReq struct {
TargetList []int64 `json:"target_list"`
}
type CSFetchUserProfileRsp ¶
type CSFetchUserProfileRsp struct {
Profiles map[int64]*UserProfile `json:"profiles"`
}
type CSGroupGroundReq ¶
type CSGroupGroundReq struct {
StartIndex int `json:"start"` //search start index
}
type CSGroupGroundRsp ¶
type CSGroupGroundRsp struct { Count int `json:"count"` ItemList []*GroupGroundItem `json:"item_list"` }
type CSKickGroupReq ¶
type CSLoginReq ¶
type CSLoginRsp ¶
type CSLogoutReq ¶
type CSLogoutReq struct {
Uid int64 `json:"uid"`
}
type CSLogoutRsp ¶
type CSSendChatReq ¶
type CSSendChatReq struct { TempMsgId int64 `json:"temp_id"` ChatType int `json:"chat_type"` //CHAT_MSG_TYPE_XX GrpId int64 `json:"grp_id"` Content string `json:"content"` }
Send Chat
type CSSendChatRsp ¶
type CSSyncChatList ¶
type CSSyncGroupInfo ¶
type CSSyncGroupInfo struct { Field int32 `json:"field"` //refer SYNC_GROUP_FIELD_xx GrpId int64 `json:"grp_id"` GrpInfo *ChatGroup `json:"grp_info"` GrpSnap *GroupGroundItem `json:"grp_snap"` }
type CSUpdateChatReq ¶
type CSUpdateChatRsp ¶
type CSUpdateUserReq ¶
type CSUpdateUserRsp ¶
type ChatGroup ¶
type ChatGroup struct { GrpId int64 `json:"grp_id"` GrpName string `json:"grp_name"` MasterUid int64 `json:"master"` MsgCount int64 `json:"msg_count"` CreateTs int64 `json:"create"` MemCount int32 `json:"mem_count"` Members map[int64]int32 `json:"members"` Visible int32 `json:"visible"` Desc string `json:"desc"` HeadUrl string `json:"head_url"` }
type GeneralMsg ¶
type GeneralMsg struct { ProtoId int `json:"proto"` SubMsg interface{} `json:"sub"` }
* GeneralMsg
type GroupGroundItem ¶
type UserChatGroup ¶
type UserChatInfo ¶
type UserDetail ¶
type UserDetail struct { Exp int32 `json:"exp"` //Depot *UserDepot `json:"user_depot"` ChatInfo *UserChatInfo `json:"chat_info"` Desc string `json:"desc"` ClientDesKey string `json:"c_des_key"` }
Click to show internal directories.
Click to hide internal directories.