dispatch

package
v0.0.0-...-7604275 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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{}

Functions

func Dump

func Dump() string

func DumpClientIdGatewayIdMap

func DumpClientIdGatewayIdMap() string

func DumpGatewayIdPushToAllMap

func DumpGatewayIdPushToAllMap() string

func DumpGatewayIdSendMessageMap

func DumpGatewayIdSendMessageMap() string

func GenMessageID

func GenMessageID() int64

Types

type AckMessage

type AckMessage struct {
	ReceiverId string `json:"receiver_id"`
	RequestId  uint32 `json:"request_id"`
	MessageId  int64  `json:"message_id"`
}

type ClientMessage

type ClientMessage struct {
	Type string      `json:"type"`
	Data interface{} `json:"data"`
}

type FaceMessage

type FaceMessage struct {
	SenderId     string `json:"sender_id"`
	SenderName   string `json:"sender_name"`
	SenderAvatar string `json:"sender_avatar"`
	ReceiverId   string `json:"receiver_id"`
	Symbol       string `json:"symbol"`
}

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 SoundMessage struct {
	SenderId     string `json:"sender_id"`
	SenderName   string `json:"sender_name"`
	SenderAvatar string `json:"sender_avatar"`
	ReceiverId   string `json:"receiver_id"`
	Url          string `json:"url"`
	Size         uint32 `json:"size"`
	Seconds      uint32 `json:"seconds"`
}

type TextMessage

type TextMessage struct {
	SenderId     string `json:"sender_id"`
	SenderName   string `json:"sender_name"`
	SenderAvatar string `json:"sender_avatar"`
	ReceiverId   string `json:"receiver_id"`
	Content      string `json:"content"`
}

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"`
}

Jump to

Keyboard shortcuts

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