Documentation ¶
Index ¶
Constants ¶
View Source
const ( WSGetNewestSeq = 1001 WSPullMsgBySeqList = 1002 WSGetNewestGroupSeq = 1003 WSPullMsgByGroupSeqList = 1004 WSSendMsg = 2001 WSPushMsg = 2002 WSGroupPushMsg = 2003 )
msg-gateway 用到的
View Source
const ( SingleChatType = 1 GroupChatType = 2 NotificationChatType = 3 OnlineStatus = "online" OfflineStatus = "offline" )
msg 用到的
View Source
const ( //OptionsKey IsHistory = "history" IsPersistent = "persistent" IsOfflinePush = "offlinePush" IsUnreadCount = "unreadCount" IsConversationUpdate = "conversationUpdate" IsSenderSync = "senderSync" IsSenderConversationUpdate = "senderConversationUpdate" )
options
View Source
const ( Typing = 11 Text = 101 Picture = 102 Voice = 103 Video = 104 File = 105 Custom = 106 Location = 109 Merger = 110 Revoke = 111 HasReadReceipt = 112 Card = 113 Quote = 114 Common = 200 GroupMsg = 201 NotificationUser2User = 301 // 用户对用户的通知 比如添加好友请求 打招呼... 不是好友也可以发送 但是拉黑就不能发送了 )
View Source
const ( ErrCodeOK = iota // 成功 ErrCodeFailed // 失败 ErrCodeLimit // 限流 ErrCodeProtoUnmarshal = 400 // proto解析错误 ErrCodeParams = 401 // 参数错误 )
error code
View Source
const ( //MsgFrom UserMsgType = 100 SysMsgType = 200 )
View Source
const ( //Platform ID IOSPlatformID = 1 AndroidPlatformID = 2 WindowsPlatformID = 3 OSXPlatformID = 4 LinuxPlatformID = 5 WebPlatformID = 6 MiniWebPlatformID = 7 //Platform string match to Platform ID IOSPlatformStr = "IOS" AndroidPlatformStr = "Android" WindowsPlatformStr = "Windows" OSXPlatformStr = "OSX" WebPlatformStr = "Web" MiniWebPlatformStr = "MiniWeb" LinuxPlatformStr = "Linux" //terminal types TerminalPC = "PC" TerminalMobile = "Mobile" )
View Source
const ( RedisKeyUserIncrSeq = "REDIS_USER_INCR_SEQ:" // user incr seq RedisKeyGroupIncrSeq = "REDIS_SUPER_GROUP_INCR_SEQ:" // user incr seq RedisKeyGroupMinSeq = "REDIS_SUPER_GROUP_MIN_SEQ:" // user incr seq RedisKeyUserMinSeq = "REDIS_USER_MIN_SEQ:" RedisKeyToken = "TOKEN:" )
View Source
const (
AtAllString = "AtAllTag"
)
Variables ¶
View Source
var ( ErrTokenExpired = fmt.Errorf("token 过期") ErrTokenInvalid = fmt.Errorf("token 无效") ErrTokenMalformed = fmt.Errorf("token 格式错误") ErrTokenNotValidYet = fmt.Errorf("token 还未生效") ErrTokenUnknown = fmt.Errorf("未知错误") ErrTokenKicked = fmt.Errorf("被踢出") )
View Source
var ContentType2PushContent = map[int64]string{ Picture: "[图片]", Voice: "[语音]", Video: "[视频]", File: "[文件]", Text: "你收到了一条文本消息", GroupMsg: "你收到一条群聊消息", Common: "你收到一条新消息", }
View Source
var Platform2class = map[string]string{ IOSPlatformStr: TerminalMobile, AndroidPlatformStr: TerminalMobile, MiniWebPlatformStr: WebPlatformStr, WebPlatformStr: WebPlatformStr, WindowsPlatformStr: TerminalPC, OSXPlatformStr: TerminalPC, LinuxPlatformStr: TerminalPC, }
View Source
var PlatformID2Name = map[int32]string{ IOSPlatformID: IOSPlatformStr, AndroidPlatformID: AndroidPlatformStr, WindowsPlatformID: WindowsPlatformStr, OSXPlatformID: OSXPlatformStr, WebPlatformID: WebPlatformStr, MiniWebPlatformID: MiniWebPlatformStr, LinuxPlatformID: LinuxPlatformStr, }
View Source
var PlatformName2ID = map[string]int32{ IOSPlatformStr: IOSPlatformID, AndroidPlatformStr: AndroidPlatformID, WindowsPlatformStr: WindowsPlatformID, OSXPlatformStr: OSXPlatformID, WebPlatformStr: WebPlatformID, MiniWebPlatformStr: MiniWebPlatformID, LinuxPlatformStr: LinuxPlatformID, }
View Source
var WSDataError = xerr.New(3001, "ws data error")
Functions ¶
func PlatformIDToName ¶
func PlatformNameToClass ¶
func PlatformNameToID ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.