Documentation ¶
Index ¶
- Constants
- Variables
- func Dump() string
- func DumpClientIdGatewayIdMap() string
- func DumpGatewayIdPushToAllMap() string
- func DumpGatewayIdSendMessageMap() string
- func GenMessageID() int64
- func ParseMessage(req *proto_build.SendMessageRequest) (string, string, uint64, int64, string, []byte, []byte, error)
- type AckMessage
- type ClientMessage
- type FaceMessage
- type FileMessage
- type ImageMessage
- type LocationMessage
- type SoundMessage
- type TextMessage
- type VideoMessage
Constants ¶
View Source
const ( MessageTypeText = "text" MessageTypeLocation = "location" MessageTypeFace = "face" MessageTypeSound = "sound" MessageTypeImage = "image" MessageTypeFile = "file" MessageTypeVideo = "video" MessageTypeAck = "ack" )
View Source
const ( BusinessCmdPing = "A001" //ping BusinessCmdPong = "A002" //pong BusinessCmdServerClose = "A999" //close:服务端断开 BusinessCmdClientClose = "A998" //close:客户端断开 BusinessCmdAuthLogin = "B001" //请求登录 BusinessCmdAuthSuccess = "B002" //认证成功 BusinessCmdAuthFail = "B003" //认证失败 BusinessCmdAuthLogout = "B004" //退出 BusinessCmdC2C = "B101" //C2C单聊消息 BusinessCmdC2G = "B102" //C2G群聊消息 BusinessCmdS2C = "B103" //S2C系统推送消息 )
View Source
const (
BusinessHeaderFlag = "jim1"
)
Variables ¶
View Source
var ClientIdGatewayIdMap = sync.Map{}
View Source
var GatewayIdPushToAllMap = sync.Map{}
View Source
var GatewayIdSendMessageMap = sync.Map{}
View Source
var MessageTypeToDbType = map[string]int32{ MessageTypeText: 1, MessageTypeLocation: 2, MessageTypeFace: 3, MessageTypeSound: 4, MessageTypeImage: 5, MessageTypeFile: 6, MessageTypeVideo: 7, MessageTypeAck: 8, }
Functions ¶
func DumpClientIdGatewayIdMap ¶
func DumpClientIdGatewayIdMap() string
func DumpGatewayIdPushToAllMap ¶
func DumpGatewayIdPushToAllMap() string
func DumpGatewayIdSendMessageMap ¶
func DumpGatewayIdSendMessageMap() string
func GenMessageID ¶
func GenMessageID() int64
func ParseMessage ¶
func ParseMessage(req *proto_build.SendMessageRequest) (string, string, uint64, int64, string, []byte, []byte, error)
Types ¶
type AckMessage ¶
type ClientMessage ¶
type ClientMessage struct { Type string `json:"type"` Data interface{} `json:"data"` }
type FaceMessage ¶
type FileMessage ¶
type FileMessage struct { SenderId string `json:"sender_id"` SenderName string `json:"sender_name"` SenderAvatar string `json:"sender_avatar"` ReceiverId string `json:"receiver_id"` Size uint32 `json:"size"` Name string `json:"name"` Format uint32 `json:"format"` ThumbUrl string `json:"thumb_url"` Url string `json:"url"` }
type ImageMessage ¶
type ImageMessage struct { SenderId string `json:"sender_id"` SenderName string `json:"sender_name"` SenderAvatar string `json:"sender_avatar"` ReceiverId string `json:"receiver_id"` Format uint32 `json:"format"` Size uint32 `json:"size "` Width uint32 `json:"width "` Height uint32 `json:"height "` IconUrl string `json:"icon_url "` BigUrl string `json:"big_url "` }
type LocationMessage ¶
type LocationMessage struct { SenderId string `json:"sender_id"` SenderName string `json:"sender_name"` SenderAvatar string `json:"sender_avatar"` ReceiverId string `json:"receiver_id"` CoverImage string `json:"cover_image"` Lat float64 `json:"lat"` Lng float64 `json:"lng"` MapLink string `json:"map_link"` Desc string `json:"desc"` }
type SoundMessage ¶
type TextMessage ¶
type VideoMessage ¶
type VideoMessage struct { SenderId string `json:"sender_id"` SenderName string `json:"sender_name"` SenderAvatar string `json:"sender_avatar"` ReceiverId string `json:"receiver_id"` Size uint32 `json:"size"` Seconds uint32 `json:"seconds"` Url string `json:"url"` Format uint32 `json:"format"` ThumbUrl string `json:"thumb_url"` ThumbSize uint32 `json:"thumb_size"` ThumbWidth uint32 `json:"thumb_width"` ThumbHeight uint32 `json:"thumb_height"` ThumbFormat uint32 `json:"thumb_format"` }
Click to show internal directories.
Click to hide internal directories.