Documentation
¶
Index ¶
Constants ¶
View Source
const ( CmdFriend = "001" CmdBlackList = "002" CmdFriendApplication = "003" CmdDeleteConversation = "004" CmdNewMsgCome = "005" CmdSuperGroupMsgCome = "006" CmdUpdateConversation = "007" CmSyncReactionExtensions = "008" CmdFroceSyncBlackList = "009" CmdForceSyncFriendApplication = "010" CmdForceSyncMsg = "011" CmdForceSyncLoginUerInfo = "012" CmdReLogin = "013" CmdUnInit = "014" CmdAcceptFriend = "015" CmdRefuseFriend = "016" CmdAddFriend = "017" CmdJoinedSuperGroup = "018" CmdUpdateMessage = "019" CmdMaxSeq = "maxSeq" CmdPushMsg = "pushMsg" CmdLogout = "Logout" CmdWakeUp = "wakeUp" )
View Source
const ( //ContentType Text = 101 Picture = 102 Voice = 103 Video = 104 File = 105 AtText = 106 Merger = 107 Card = 108 Location = 109 Custom = 110 Revoke = 111 //影响前者消息 HasReadReceipt = 112 //影响前者消息 Typing = 113 Quote = 114 Face = 115 GroupHasReadReceipt = 116 //影响前者消息 AdvancedText = 117 AdvancedRevoke = 118 //影响前者消息 CustomMsgNotTriggerConversation = 119 CustomMsgOnlineOnly = 120 ReactionMessageModifier = 121 ReactionMessageDeleter = 122 ////////////////////////////////////////// NotificationBegin = 1000 FriendNotificationBegin = 1200 FriendApplicationApprovedNotification = 1201 //add_friend_response FriendApplicationRejectedNotification = 1202 //add_friend_response FriendApplicationNotification = 1203 //add_friend FriendAddedNotification = 1204 FriendDeletedNotification = 1205 //delete_friend FriendRemarkSetNotification = 1206 //set_friend_remark? BlackAddedNotification = 1207 //add_black BlackDeletedNotification = 1208 //remove_black FriendInfoUpdatedNotification = 1209 FriendNotificationEnd = 1299 ConversationChangeNotification = 1300 UserNotificationBegin = 1301 UserInfoUpdatedNotification = 1303 //SetSelfInfoTip = 204 UserNotificationEnd = 1399 OANotification = 1400 GroupNotificationBegin = 1500 GroupCreatedNotification = 1501 GroupInfoSetNotification = 1502 JoinGroupApplicationNotification = 1503 MemberQuitNotification = 1504 GroupApplicationAcceptedNotification = 1505 GroupApplicationRejectedNotification = 1506 GroupOwnerTransferredNotification = 1507 MemberKickedNotification = 1508 MemberInvitedNotification = 1509 MemberEnterNotification = 1510 GroupDismissedNotification = 1511 GroupMemberMutedNotification = 1512 GroupMemberCancelMutedNotification = 1513 GroupMutedNotification = 1514 GroupCancelMutedNotification = 1515 GroupMemberInfoSetNotification = 1516 GroupMemberSetToAdminNotification = 1517 GroupMemberSetToOrdinaryUserNotification = 1518 GroupNotificationEnd = 1599 SignalingNotificationBegin = 1600 SignalingNotification = 1601 SignalingNotificationEnd = 1649 SuperGroupNotificationBegin = 1650 SuperGroupUpdateNotification = 1651 MsgDeleteNotification = 1652 ReactionMessageModifierNotification = 1653 ReactionMessageDeleteNotification = 1654 SuperGroupNotificationEnd = 1699 ConversationPrivateChatNotification = 1701 ConversationUnreadNotification = 1702 OrganizationChangedNotification = 1801 WorkMomentNotificationBegin = 1900 WorkMomentNotification = 1901 BusinessNotificationBegin = 2000 BusinessNotification = 2001 BusinessNotificationEnd = 2099 NotificationEnd = 2200 //MsgFrom UserMsgType = 100 SysMsgType = 200 ///////////////////////////////////// //SessionType SingleChatType = 1 GroupChatType = 2 SuperGroupChatType = 3 NotificationChatType = 4 //MsgStatus MsgStatusDefault = 0 MsgStatusSending = 1 MsgStatusSendSuccess = 2 MsgStatusSendFailed = 3 MsgStatusHasDeleted = 4 MsgStatusRevoked = 5 MsgStatusFiltered = 6 //OptionsKey IsHistory = "history" IsPersistent = "persistent" IsUnreadCount = "unreadCount" IsConversationUpdate = "conversationUpdate" IsOfflinePush = "offlinePush" IsSenderSync = "senderSync" IsNotPrivate = "notPrivate" IsSenderConversationUpdate = "senderConversationUpdate" IsSenderNotificationPush = "senderNotificationPush" //GroupStatus GroupOk = 0 GroupBanChat = 1 GroupStatusDismissed = 2 GroupStatusMuted = 3 // workMoment permission WorkMomentPublic = 0 WorkMomentPrivate = 1 WorkMomentPermissionCanSee = 2 WorkMomentPermissionCantSee = 3 // workMoment sdk notification type WorkMomentCommentNotification = 0 WorkMomentLikeNotification = 1 WorkMomentAtUserNotification = 2 )
View Source
const ( BlackRelationship = 0 FriendRelationship = 1 )
View Source
const ( NormalGroup = 0 SuperGroup = 1 WorkingGroup = 2 SuperGroupTableName = "local_super_groups" SuperGroupErrChatLogsTableNamePre = "local_sg_err_chat_logs_" SuperGroupChatLogsTableNamePre = "local_sg_chat_logs_" )
const (
ErrCodeInitLogin = 1001 ErrCodeFriend = 2001 ErrCodeConversation = 3001 ErrCodeUserInfo = 4001 ErrCodeGroup = 5001
)
View Source
const ( SdkInit = 0 LoginSuccess = 101 Logining = 102 LoginFailed = 103 Logout = 201 TokenFailedExpired = 701 TokenFailedInvalid = 702 TokenFailedKickedOffline = 703 )
View Source
const ( AddConOrUpLatMsg = 2 UnreadCountSetZero = 3 IncrUnread = 5 TotalUnreadMessageChanged = 6 UpdateConFaceUrlAndNickName = 7 UpdateLatestMessageChange = 8 ConChange = 9 NewCon = 10 ConChangeDirect = 11 NewConDirect = 12 ConversationLatestMsgHasRead = 13 UpdateMsgFaceUrlAndNickName = 14 SyncConversation = 15 SyncMessageListReactionExtensions = 16 SyncMessageListTypeKeyInfo = 17 HasRead = 1 NotRead = 0 IsFilter = 1 NotFilter = 0 )
View Source
const ( GroupActionCreateGroup = 1 GroupActionApplyJoinGroup = 2 GroupActionQuitGroup = 3 GroupActionSetGroupInfo = 4 GroupActionKickGroupMember = 5 GroupActionTransferGroupOwner = 6 GroupActionInviteUserToGroup = 7 GroupActionAcceptGroupApplication = 8 GroupActionRefuseGroupApplication = 9 )
View Source
const ( FriendAcceptTip = "You have successfully become friends, so start chatting" TransferGroupTip = "The owner of the group is transferred!" AcceptGroupTip = "%s join the group" )
const MaxTotalMsgLen = 20480
View Source
const ( WSGetNewestSeq = 1001 WSPullMsgBySeqList = 1002 WSSendMsg = 1003 WSSendSignalMsg = 1004 WsDelMsg = 1005 WSPushMsg = 2001 WSKickOnlineMsg = 2002 WsLogoutMsg = 2003 WsSetBackgroundStatus = 2004 WSDataError = 3001 )
View Source
const ( //MsgReceiveOpt ReceiveMessage = 0 NotReceiveMessage = 1 ReceiveNotNotifyMessage = 2 //pinned Pinned = 1 NotPinned = 0 //privateChat IsPrivateChat = true NotPrivateChat = false )
conversation
View Source
const ( AppOrdinaryUsers = 1 AppAdmin = 2 GroupOrdinaryUsers = 1 GroupOwner = 2 GroupAdmin = 3 GroupAdminAndOrdinaryUsers = 4 GroupResponseAgree = 1 GroupResponseRefuse = -1 FriendResponseAgree = 1 FriendResponseRefuse = -1 Male = 1 Female = 2 )
View Source
const ( AtAllString = "AtAllTag" AtNormal = 0 AtMe = 1 AtAll = 2 AtAllAtMe = 3 )
View Source
const ( FieldRecvMsgOpt = 1 FieldIsPinned = 2 FieldAttachedInfo = 3 FieldIsPrivateChat = 4 FieldGroupAtType = 5 FieldIsNotInGroup = 6 FieldEx = 7 FieldUnread = 8 FieldBurnDuration = 9 )
View Source
const ( SetMessageExtensions = 1 AddMessageExtensions = 2 )
View Source
const ( KeywordMatchOr = 0 KeywordMatchAnd = 1 )
View Source
const ( MsgSyncModelDefault = 0 //SyncFlag MsgSyncModelLogin = 1 //SyncFlag SyncOrderStartLatest = 101 //PullMsgOrder MsgSyncBegin = 1001 // MsgSyncProcessing = 1002 // MsgSyncEnd = 1003 // MsgSyncFailed = 1004 )
View Source
const ( JoinByInvitation = 2 JoinBySearch = 3 JoinByQRCode = 4 )
View Source
const ( SplitPullMsgNum = 100 PullMsgNumWhenLogin = 10000 PullMsgNumForReadDiffusion = 100 NormalMsgMinNumReadDiffusion = 100 )
View Source
const ( StatusErrTokenExpired = 701 StatusErrTokenInvalid = 702 StatusErrTokenMalformed = 703 StatusErrTokenNotValidYet = 704 StatusErrTokenUnknown = 705 StatusErrTokenKicked = 706 )
View Source
const ( //Platform ID IOSPlatformID = 1 AndroidPlatformID = 2 WindowsPlatformID = 3 OSXPlatformID = 4 WebPlatformID = 5 MiniWebPlatformID = 6 LinuxPlatformID = 7 AndroidPadPlatformID = 8 IPadPlatformID = 9 //Platform string match to Platform ID IOSPlatformStr = "IOS" AndroidPlatformStr = "Android" WindowsPlatformStr = "Windows" OSXPlatformStr = "OSX" WebPlatformStr = "Web" MiniWebPlatformStr = "MiniWeb" LinuxPlatformStr = "Linux" AndroidPadPlatformStr = "APad" IPadPlatformStr = "IPad" //terminal types TerminalPC = "PC" TerminalMobile = "Mobile" )
View Source
const ( GetSelfUserInfoRouter = "/user/get_self_user_info" GetUsersInfoRouter = "/user/get_users_info" UpdateSelfUserInfoRouter = "/user/update_user_info" SetGlobalRecvMessageOptRouter = "/user/set_global_msg_recv_opt" GetUsersInfoFromCacheRouter = "/user/get_users_info_from_cache" AddFriendRouter = "/friend/add_friend" DeleteFriendRouter = "/friend/delete_friend" GetFriendApplicationListRouter = "/friend/get_friend_apply_list" //recv GetSelfFriendApplicationListRouter = "/friend/get_self_friend_apply_list" //send GetFriendListRouter = "/friend/get_friend_list" AddFriendResponse = "/friend/add_friend_response" SetFriendRemark = "/friend/set_friend_remark" AddBlackRouter = "/friend/add_black" RemoveBlackRouter = "/friend/remove_black" GetBlackListRouter = "/friend/get_black_list" SendMsgRouter = "/chat/send_msg" PullUserMsgRouter = "/chat/pull_msg" PullUserMsgBySeqRouter = "/chat/pull_msg_by_seq" NewestSeqRouter = "/chat/newest_seq" //msg DeleteMsgRouter = RouterMsg + "/del_msg" ClearMsgRouter = RouterMsg + "/clear_msg" DeleteSuperGroupMsgRouter = RouterMsg + "/del_super_group_msg" SetMessageReactionExtensionsRouter = RouterMsg + "/set_message_reaction_extensions" AddMessageReactionExtensionsRouter = RouterMsg + "/add_message_reaction_extensions" GetMessageListReactionExtensionsRouter = RouterMsg + "/get_message_list_reaction_extensions" DeleteMessageReactionExtensionsRouter = RouterMsg + "//delete_message_reaction_extensions" TencentCloudStorageCredentialRouter = "/third/tencent_cloud_storage_credential" AliOSSCredentialRouter = "/third/ali_oss_credential" MinioStorageCredentialRouter = "/third/minio_storage_credential" AwsStorageCredentialRouter = "/third/aws_storage_credential" //group CreateGroupRouter = RouterGroup + "/create_group" SetGroupInfoRouter = RouterGroup + "/set_group_info" JoinGroupRouter = RouterGroup + "/join_group" QuitGroupRouter = RouterGroup + "/quit_group" GetGroupsInfoRouter = RouterGroup + "/get_groups_info" GetGroupAllMemberListRouter = RouterGroup + "/get_group_all_member_list" GetGroupMembersInfoRouter = RouterGroup + "/get_group_members_info" InviteUserToGroupRouter = RouterGroup + "/invite_user_to_group" GetJoinedGroupListRouter = RouterGroup + "/get_joined_group_list" KickGroupMemberRouter = RouterGroup + "/kick_group" TransferGroupRouter = RouterGroup + "/transfer_group" GetRecvGroupApplicationListRouter = RouterGroup + "/get_recv_group_applicationList" GetSendGroupApplicationListRouter = RouterGroup + "/get_user_req_group_applicationList" AcceptGroupApplicationRouter = RouterGroup + "/group_application_response" RefuseGroupApplicationRouter = RouterGroup + "/group_application_response" DismissGroupRouter = RouterGroup + "/dismiss_group" MuteGroupMemberRouter = RouterGroup + "/mute_group_member" CancelMuteGroupMemberRouter = RouterGroup + "/cancel_mute_group_member" MuteGroupRouter = RouterGroup + "/mute_group" CancelMuteGroupRouter = RouterGroup + "/cancel_mute_group" SetGroupMemberNicknameRouter = RouterGroup + "/set_group_member_nickname" SetGroupMemberInfoRouter = RouterGroup + "/set_group_member_info" GetGroupAbstractInfoRouter = RouterGroup + "/get_group_abstract_info" SetReceiveMessageOptRouter = "/conversation/set_receive_message_opt" GetReceiveMessageOptRouter = "/conversation/get_receive_message_opt" GetAllConversationMessageOptRouter = "/conversation/get_all_conversation_message_opt" SetConversationOptRouter = ConversationGroup + "/set_conversation" GetConversationsRouter = ConversationGroup + "/get_conversations" GetAllConversationsRouter = ConversationGroup + "/get_all_conversations" GetConversationRouter = ConversationGroup + "/get_conversation" BatchSetConversationRouter = ConversationGroup + "/batch_set_conversation" ModifyConversationFieldRouter = ConversationGroup + "/modify_conversation_field" //organization GetSubDepartmentRouter = RouterOrganization + "/get_sub_department" GetDepartmentMemberRouter = RouterOrganization + "/get_department_member" ParseTokenRouter = RouterAuth + "/parse_token" //super_group GetJoinedSuperGroupListRouter = RouterSuperGroup + "/get_joined_group_list" GetSuperGroupsInfoRouter = RouterSuperGroup + "/get_groups_info" //third FcmUpdateTokenRouter = RouterThird + "/fcm_update_token" SetAppBadgeRouter = RouterThird + "/set_app_badge" )
View Source
const ( RouterGroup = "/group" ConversationGroup = "/conversation" RouterOrganization = "/organization" RouterAuth = "/auth" RouterSuperGroup = "/super_group" RouterMsg = "/msg" RouterThird = "/third" )
View Source
const ( NoError = 0 FormattingError = 10001 HasRegistered = 10002 NotRegistered = 10003 PasswordErr = 10004 GetIMTokenErr = 10005 RepeatSendCode = 10006 MailSendCodeErr = 10007 SmsSendCodeErr = 10008 CodeInvalidOrExpired = 10009 RegisterFailed = 10010 ResetPasswordFailed = 10011 DatabaseError = 10002 ServerError = 10004 HttpError = 10005 IoError = 10006 IntentionalError = 10007 )
View Source
const BigVersion = "v2"
View Source
const (
DeFaultSuccessMsg = "ok"
)
View Source
const LogFileName = "sdk"
View Source
const MaxTotalMsgLen = 51200
View Source
const SdkVersion = "Open-IM-SDK-Core-"
View Source
const SplitGetGroupMemberNum = 1000
View Source
const SuccessCallbackDefault = ""
View Source
const UpdateVersion = ".0.0"
View Source
const UseHashGroupMemberNum = 1000
View Source
const ZoomScale = "200"
Variables ¶
View Source
var ( OK = ErrInfo{0, ""} ErrParseToken = ErrInfo{200, ParseTokenMsg.Error()} ErrTencentCredential = ErrInfo{400, ThirdPartyMsg.Error()} ErrInBlackList = ErrInfo{ErrCode: 600, ErrMsg: InBlackList.Error()} ErrNotFriend = ErrInfo{ErrCode: 601, ErrMsg: NotFriend.Error()} ErrTokenExpired = ErrInfo{701, TokenExpiredMsg.Error()} ErrTokenInvalid = ErrInfo{702, TokenInvalidMsg.Error()} ErrTokenMalformed = ErrInfo{703, TokenMalformedMsg.Error()} ErrTokenNotValidYet = ErrInfo{704, TokenNotValidYetMsg.Error()} ErrTokenUnknown = ErrInfo{705, TokenUnknownMsg.Error()} ErrTokenKicked = ErrInfo{706, TokenUserKickedMsg.Error()} ErrAccess = ErrInfo{ErrCode: 801, ErrMsg: AccessMsg.Error()} ErrDB = ErrInfo{ErrCode: 802, ErrMsg: DBMsg.Error()} ErrArgs = ErrInfo{ErrCode: 803, ErrMsg: ArgsMsg.Error()} ErrApi = ErrInfo{ErrCode: 804, ErrMsg: ApiMsg.Error()} ErrData = ErrInfo{ErrCode: 805, ErrMsg: DataMsg.Error()} ErrLogin = ErrInfo{ErrCode: 806, ErrMsg: LoginMsg.Error()} ErrConfig = ErrInfo{ErrCode: 807, ErrMsg: ConfigMsg.Error()} ErrThirdParty = ErrInfo{ErrCode: 808, ErrMsg: ThirdPartyMsg.Error()} ErrServerReturn = ErrInfo{ErrCode: 809, ErrMsg: ServerReturn.Error()} ErrWsRecvConnDiff = ErrInfo{ErrCode: 901, ErrMsg: WsRecvConnDiff.Error()} ErrWsRecvConnSame = ErrInfo{ErrCode: 902, ErrMsg: WsRecvConnSame.Error()} ErrWsRecvCode = ErrInfo{ErrCode: 903, ErrMsg: WsRecvCode.Error()} ErrWsSendTimeout = ErrInfo{ErrCode: 904, ErrMsg: WsSendTimeout.Error()} ErrResourceLoadNotComplete = ErrInfo{ErrCode: 905, ErrMsg: ResourceLoadNotComplete.Error()} ErrNotSupportFunction = ErrInfo{ErrCode: 906, ErrMsg: NotSupportFunction.Error()} )
View Source
var ( ParseTokenMsg = errors.New("parse token failed") TokenExpiredMsg = errors.New("token is timed out, please log in again") TokenInvalidMsg = errors.New("token has been invalidated") TokenNotValidYetMsg = errors.New("token not active yet") TokenMalformedMsg = errors.New("that's not even a token") TokenUnknownMsg = errors.New("couldn't handle this token") TokenUserKickedMsg = errors.New("user has been kicked") AccessMsg = errors.New("no permission") DBMsg = errors.New("db failed") ArgsMsg = errors.New("args failed") ApiMsg = errors.New("api failed") DataMsg = errors.New("data failed ") LoginMsg = errors.New("you can only login once") ConfigMsg = errors.New("config failed") ThirdPartyMsg = errors.New("third party error") ServerReturn = errors.New("server return data err") WsRecvConnDiff = errors.New("recv timeout, conn diff") WsRecvConnSame = errors.New("recv timeout, conn same") WsRecvCode = errors.New("recv code err") WsSendTimeout = errors.New("send timeout") ResourceLoadNotComplete = errors.New("resource loading is not complete") NotSupportFunction = errors.New("unsupported function") NotFriend = errors.New("not friend") InBlackList = errors.New("in blackList") )
View Source
var ( ErrServer = ErrInfo{500, "server error"} ErrTokenDifferentPlatformID = ErrInfo{707, TokenDifferentPlatformIDMsg.Error()} ErrTokenDifferentUserID = ErrInfo{708, TokenDifferentUserIDMsg.Error()} ErrStatus = ErrInfo{ErrCode: 804, ErrMsg: StatusMsg.Error()} ErrCallback = ErrInfo{ErrCode: 809, ErrMsg: CallBackMsg.Error()} ErrSendLimit = ErrInfo{ErrCode: 810, ErrMsg: "send msg limit, to many request, try again later"} ErrMessageHasReadDisable = ErrInfo{ErrCode: 811, ErrMsg: "message has read disable"} ErrInternal = ErrInfo{ErrCode: 812, ErrMsg: "internal error"} )
View Source
var ( TokenDifferentPlatformIDMsg = errors.New("different platformID") TokenDifferentUserIDMsg = errors.New("different userID") StatusMsg = errors.New("status is abnormal") CallBackMsg = errors.New("callback failed") )
View Source
var HeartbeatInterval = 5
View Source
var KEY = "openIMtest123456789"
View Source
var OnlyForTest = 0
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[int]string{ IOSPlatformID: IOSPlatformStr, AndroidPlatformID: AndroidPlatformStr, WindowsPlatformID: WindowsPlatformStr, OSXPlatformID: OSXPlatformStr, WebPlatformID: WebPlatformStr, MiniWebPlatformID: MiniWebPlatformStr, LinuxPlatformID: LinuxPlatformStr, AndroidPadPlatformID: AndroidPadPlatformStr, IPadPlatformID: IPadPlatformStr, }
View Source
var PlatformName2ID = map[string]int{ IOSPlatformStr: IOSPlatformID, AndroidPlatformStr: AndroidPlatformID, WindowsPlatformStr: WindowsPlatformID, OSXPlatformStr: OSXPlatformID, WebPlatformStr: WebPlatformID, MiniWebPlatformStr: MiniWebPlatformID, LinuxPlatformStr: LinuxPlatformID, AndroidPadPlatformStr: AndroidPadPlatformID, IPadPlatformStr: IPadPlatformID, }
Functions ¶
func PlatformIDToName ¶
func PlatformNameToClass ¶
func PlatformNameToID ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.