Documentation
¶
Index ¶
- func ComposeAddFriendAlert(alertType int, operator, name, targetId, targetName, msg string) map[string]interface{}
- func ComposeAlert(alertType int, operator, name, msg string) map[string]interface{}
- func ComposeCreateRoomMemberAlert(alertType int, ...) map[string]interface{}
- func ComposeDelFriendAlert(alertType int, operator, targetId, msg string) map[string]interface{}
- func ComposeForwardMsg(channelType int, fromId, fromName, forwardUserName string, ...) map[string]interface{}
- func ComposeHadBurntAlert(channelType int, logId string) map[string]interface{}
- func ComposeInviteRoomAlert(alertType int, operator, name string, users, names []string, msg string) map[string]interface{}
- func ComposeKickOutAlert(alertType int, operator, targetId, targetName, msg string) map[string]interface{}
- func ComposePaymentAlert(operator, logId, recordId string) map[string]interface{}
- func ComposePraiseAlert(logId, operator, action string, like, reward int) map[string]interface{}
- func ComposePrintScreen(operator string) map[string]interface{}
- func ComposeRPReceiveAlert(alertType int, operator, name, owner, ownerName, packetId, msg string) map[string]interface{}
- func ComposeRevokeAlert(logId, operator, name, msg string, level int) map[string]interface{}
- func ComposeRoomInviteCard(roomId, markId, roomName, inviter, avatar, identificationInfo string) map[string]interface{}
- func ComposeRoomInviteReject(operator, targetId, targetName, msg string) map[string]interface{}
- func ComposeRoomMutedAlert(operator string, mutedType, level, opt int, names []string, msg string) map[string]interface{}
- func ComposeSetMemberLevelAlert(alertType int, operator, targetId, targetName, msg string) map[string]interface{}
- func ComposeSetRoomNameAlert(alertType int, operator, name, roomName, msg string) map[string]interface{}
- func ComposeSingleForwardMsg(channelType int, fromId, fromName string, data *types.ChatLog) map[string]interface{}
- func ComposeSystemMsg(msg string) map[string]interface{}
- func ComposeUpdateSKeyAlert(roomId, fromKey, kid, key string) map[string]interface{}
- func GetProtocolReceiver() map[int]ProtocolReceiver
- func NewMsg(mp map[string]interface{}) msg
- func SendAckSuccessNotification(client *router.Client, begin, end int64)
- func SendAddFriendNotification(userId, logId, reason, source string, source2 interface{}, status int, ...)
- func SendApplyNotification(applyInfo *types.ApplyList, members []string)
- func SendBatchSuccessNotification(client *router.Client)
- func SendCloseUserAccountNotification(deadline int64, userId, content string)
- func SendClosedRoomNotification(roomId, content string, deadline int64)
- func SendCreateRoomNotification(roomId string)
- func SendGetSKeySuccessNotification(client *router.Client)
- func SendJoinRoomNotification(roomId string, members []string)
- func SendLogOutRoomNotification(logOutType int, roomId, userId string, content string, members []string)
- func SendOtherDeviceLogin(alertMsg string, client *router.Client)
- func SendRemoveRoomNotification(operator, roomId string)
- func SendRoomMutedNotification(roomId string, mutedType int, deadline int64, members []string)
- func SendUpdatePubKeyNotification(userId, publicKey, privateKey string, users []string)
- type EventAck
- type EventGetSKey
- type EventSyncMsg
- type EventUpdatePubKey
- type EventUpdateSKey
- type IBaseProto
- type JoinRoomNotification
- type LogOutRoomNotification
- type Proto
- func (p *Proto) AppendChatLog(userId string, state int, time int64) error
- func (p *Proto) FromBytes(b []byte) error
- func (p *Proto) GetChannelType() int
- func (p *Proto) GetEvType() int
- func (p *Proto) GetExt() interface{}
- func (p *Proto) GetGTMsg(fromId string) string
- func (p *Proto) GetIsSnap() int
- func (p *Proto) GetLogId() string
- func (p *Proto) GetMsg() map[string]interface{}
- func (p *Proto) GetMsgId() string
- func (p *Proto) GetMsgType() int
- func (p *Proto) GetPraise() interface{}
- func (p *Proto) GetRouter() string
- func (p *Proto) GetSendTime() int64
- func (p *Proto) GetTargetId() string
- func (p *Proto) IsEncryptedMsg() bool
- func (p *Proto) IsSpecial() bool
- func (p *Proto) Receive(conn router.Connection, msg []byte)
- func (p *Proto) SetLogId(logId string)
- func (p *Proto) SetTargetId(targetId string)
- func (p *Proto) WrapResp(user *types.User, sendTime int64) ([]byte, error)
- type ProtocolCreator
- type ProtocolReceiver
- type RemoveClosedNotification
- type RemoveRoomNotification
- type RoomMutedNotification
- type RoomOnlineNumberNotification
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeAddFriendAlert ¶
func ComposeAlert ¶
func ComposeDelFriendAlert ¶
func ComposeForwardMsg ¶
func ComposeForwardMsg(channelType int, fromId, fromName, forwardUserName string, data []*types.ChatLog) map[string]interface{}
组合成转发消息
func ComposeHadBurntAlert ¶
焚毁消息通知
func ComposeInviteRoomAlert ¶
func ComposeKickOutAlert ¶
func ComposePaymentAlert ¶
收款成功消息通知
func ComposePraiseAlert ¶
赞赏通知
func ComposePrintScreen ¶
func ComposeRPReceiveAlert ¶
func ComposeRevokeAlert ¶
撤回消息通知
func ComposeRoomInviteCard ¶
func ComposeRoomInviteReject ¶
拒绝加入群聊
func ComposeRoomMutedAlert ¶
func ComposeRoomMutedAlert(operator string, mutedType, level, opt int, names []string, msg string) map[string]interface{}
群禁言消息通知
func ComposeSetRoomNameAlert ¶
func ComposeSingleForwardMsg ¶
func ComposeSystemMsg ¶
func ComposeUpdateSKeyAlert ¶
更新群秘钥消息
func GetProtocolReceiver ¶
func GetProtocolReceiver() map[int]ProtocolReceiver
func SendAckSuccessNotification ¶
ack完成通知
func SendAddFriendNotification ¶
func SendAddFriendNotification(userId, logId, reason, source string, source2 interface{}, status int, senderInfo, receiveInfo map[string]interface{})
发送添加好友通知 S->C
func SendApplyNotification ¶
发送入群请求和回复通知
func SendCloseUserAccountNotification ¶
发送封号通知
func SendClosedRoomNotification ¶
发送封群通知
func SendGetSKeySuccessNotification ¶
群会话秘钥同步完成通知
func SendJoinRoomNotification ¶
发送入群通知
func SendLogOutRoomNotification ¶
func SendLogOutRoomNotification(logOutType int, roomId, userId string, content string, members []string)
发送退出群通知
func SendOtherDeviceLogin ¶
其他设备登录
func SendRoomMutedNotification ¶
发送群中被禁言通知
func SendUpdatePubKeyNotification ¶
发送更新用户公钥通知 S->C
Types ¶
type EventGetSKey ¶
type EventGetSKey struct {
// contains filtered or unexported fields
}
同步群会话秘钥
func (*EventGetSKey) FromBytes ¶
func (p *EventGetSKey) FromBytes(b []byte) error
func (*EventGetSKey) GetDatetime ¶
func (p *EventGetSKey) GetDatetime() int64
func (*EventGetSKey) Receive ¶
func (p *EventGetSKey) Receive(conn router.Connection, msg []byte)
type EventSyncMsg ¶
type EventSyncMsg struct {
// contains filtered or unexported fields
}
开始同步消息
func (*EventSyncMsg) FromBytes ¶
func (p *EventSyncMsg) FromBytes(b []byte) error
func (*EventSyncMsg) GetTime ¶
func (p *EventSyncMsg) GetTime() int64
func (*EventSyncMsg) Receive ¶
func (p *EventSyncMsg) Receive(conn router.Connection, msg []byte)
type EventUpdatePubKey ¶
用户更新公钥
func (*EventUpdatePubKey) FromBytes ¶
func (p *EventUpdatePubKey) FromBytes(b []byte) error
func (*EventUpdatePubKey) Receive ¶
func (p *EventUpdatePubKey) Receive(conn router.Connection, msg []byte)
type EventUpdateSKey ¶
type EventUpdateSKey struct {
// contains filtered or unexported fields
}
更新会话秘钥
func (*EventUpdateSKey) FromBytes ¶
func (p *EventUpdateSKey) FromBytes(b []byte) error
func (*EventUpdateSKey) GetFromKey ¶
func (p *EventUpdateSKey) GetFromKey() string
func (*EventUpdateSKey) GetRoomId ¶
func (p *EventUpdateSKey) GetRoomId() string
func (*EventUpdateSKey) GetSecret ¶
func (p *EventUpdateSKey) GetSecret() []secretInfo
func (*EventUpdateSKey) Receive ¶
func (p *EventUpdateSKey) Receive(conn router.Connection, msg []byte)
type IBaseProto ¶
type IBaseProto interface {
Receive(router.Connection, []byte)
}
func CreateProto ¶
func CreateProto(b []byte) (IBaseProto, error)
type JoinRoomNotification ¶
type JoinRoomNotification struct { EventType int `json:"eventType"` RoomId string `json:"roomId"` Datetime int64 `json:"datetime"` }
被拉入群通知
type LogOutRoomNotification ¶
type LogOutRoomNotification struct { EventType int `json:"eventType"` RoomId string `json:"roomId"` UserId string `json:"userId"` Type int `json:"type"` Content string `json:"content"` }
退群通知
type Proto ¶
type Proto struct {
// contains filtered or unexported fields
}
客户端发送的消息结构
func NewCmnProto ¶
func NewCmnProto(logId, msgId, targetId string, chType, msgType, isSnap int, msg map[string]interface{}, sendTime int64, praise interface{}) (*Proto, error)
普通消息
func (*Proto) AppendChatLog ¶
TODO
func (*Proto) GetChannelType ¶
func (*Proto) GetMsgType ¶
func (*Proto) GetSendTime ¶
func (*Proto) GetTargetId ¶
func (*Proto) IsEncryptedMsg ¶
func (*Proto) SetTargetId ¶
type ProtocolCreator ¶
type ProtocolCreator func() IBaseProto
type ProtocolReceiver ¶
type ProtocolReceiver func(IBaseProto, router.Connection, []byte)
type RemoveClosedNotification ¶
type RemoveClosedNotification struct { EventType int `json:"eventType"` RoomId string `json:"roomId"` Content string `json:"content"` DisableDeadline int64 `json:"disableDeadline"` Datetime int64 `json:"datetime"` }
被封禁群通知
type RemoveRoomNotification ¶
type RemoveRoomNotification struct { EventType int `json:"eventType"` RoomId string `json:"roomId"` UserId string `json:"userId"` Datetime int64 `json:"datetime"` }
被解散群通知
Click to show internal directories.
Click to hide internal directories.