constant

package
v0.0.0-...-d1760a8 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusMenusNormal 表示菜单状态正常
	StatusMenusNormal = 1

	// StatusMenusForbidden 表示菜单被禁止
	StatusMenusForbidden = 2

	// StatusUserNormal 表示账号正常状态
	StatusUserNormal = 1

	// StatusUserForbidden 表示账号处理停用状态
	StatusUserForbidden = 2
)
View Source
const (
	MsgText     = "文本"
	MsgLocation = "位置"
	MsgFace     = "表情"
	MsgSound    = "语音"
	MsgImage    = "图片"
	MsgFile     = "文件"
	MsgVideo    = "视频"
	MsgRelay    = "合并转发消息"
	MsgCustom   = "自定义"
)
View Source
const (
	TIMTextElem      = "TIMTextElem"
	TIMLocationElem  = "TIMLocationElem"
	TIMFaceElem      = "TIMFaceElem"
	TIMSoundElem     = "TIMSoundElem"
	TIMCustomElem    = "TIMCustomElem"
	TIMImageElem     = "TIMImageElem"
	TIMFileElem      = "TIMFileElem"
	TIMVideoFileElem = "TIMVideoFileElem"
	TIMRelayElem     = "TIMRelayElem"
)
View Source
const (
	//Platform ID
	IOSPlatformID        = 1
	AndroidPlatformID    = 2
	WindowsPlatformID    = 3
	OSXPlatformID        = 4
	WebPlatformID        = 5
	MiniWebPlatformID    = 6
	LinuxPlatformID      = 7
	AndroidPadPlatformID = 8
	IPadPlatformID       = 9
	AdminPlatformID      = 10

	//Platform string match to Platform ID
	IOSPlatformStr        = "IOS"
	AndroidPlatformStr    = "Android"
	WindowsPlatformStr    = "Windows"
	OSXPlatformStr        = "OSX"
	WebPlatformStr        = "Web"
	MiniWebPlatformStr    = "MiniWeb"
	LinuxPlatformStr      = "Linux"
	AndroidPadPlatformStr = "APad"
	IPadPlatformStr       = "IPad"
	AdminPlatformStr      = "Admin"

	//terminal types
	TerminalPC     = "PC"
	TerminalMobile = "Mobile"
)
View Source
const (
	IPBlackList                   = "IM_IP_BLACK_LIST"
	IPWhiteList                   = "IM_IP_WHITE_LIST"
	GroupMemberNotificationStatus = "IM_GROUP_MEMBER_NOTIFICATION_LIST:"
)
View Source
const (
	PullSingleChatHistoryMsgApi = "v4/openim/admin_getroammsg"
	PullGroupChatHistoryMsgApi  = "v4/group_open_http_svc/group_msg_get_simple"
	PullFriendListApi           = "v4/sns/friend_get"     //拉取用户好友列表接口
	AddFriendApi                = "v4/sns/friend_add"     //添加用户好友接口
	DeleteFriendApi             = "v4/sns/friend_delete"  //删除用户好友接口
	AddBlackListApi             = "v4/sns/black_list_add" //拉黑用户好友接口
	SendMsgToAllUserApi         = "v4/all_member_push/im_push"
	SendMsgToBatchUserApi       = "v4/openim/batchsendmsg"
	AddSensitiveApi             = "v4/im_msg_audit_mgr/add_cloud_audit_keywords"    //添加敏感词接口
	DeleteSensitiveApi          = "v4/im_msg_audit_mgr/delete_cloud_audit_keywords" //删除敏感词接口
)
View Source
const NormalErrPrefix = "NORMAL_ERROR@"

Variables

View Source
var (
	OK        = ErrInfo{0, ""}
	ErrServer = ErrInfo{500, "server error"}

	ErrParams = ErrInfo{ErrCode: 400, ErrMsg: "接口参数错误"}

	ErrParseToken               = ErrInfo{700, "parse token failed"}
	ErrTokenExpired             = ErrInfo{701, "token is timed out, please log in again"}
	ErrTokenInvalid             = ErrInfo{702, "token is invalid"}
	ErrTokenMalformed           = ErrInfo{703, "that's not even a token"}
	ErrTokenNotValidYet         = ErrInfo{704, "token has been invalidated"}
	ErrTokenUnknown             = ErrInfo{705, "that's not even a token"}
	ErrTokenKicked              = ErrInfo{706, "user has been kicked"}
	ErrTokenDifferentPlatformID = ErrInfo{707, "different platformID"}
	ErrTokenDifferentUserID     = ErrInfo{708, "different userID"}

	ErrAccess                = ErrInfo{ErrCode: 801, ErrMsg: "no permission"}
	ErrDB                    = ErrInfo{ErrCode: 802, ErrMsg: "db failed"}
	ErrArgs                  = ErrInfo{ErrCode: 803, ErrMsg: "args failed"}
	ErrStatus                = ErrInfo{ErrCode: 804, ErrMsg: "status is abnormal"}
	ErrCallback              = ErrInfo{ErrCode: 809, ErrMsg: "callback failed"}
	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"}
	ErrWsConnNotExist        = ErrInfo{ErrCode: 813, ErrMsg: "ws conn not exist"}

	ErrAccountHasRegistered  = ErrInfo{ErrCode: 10002, ErrMsg: "account has been registered"}
	ErrAccountHasNotRegister = ErrInfo{ErrCode: 10003, ErrMsg: "account have not register"}
	ErrPasswordError         = ErrInfo{ErrCode: 10004, ErrMsg: "password error"}
	ErrUpdateError           = ErrInfo{ErrCode: 10005, ErrMsg: "update error"}
	ErrRepeatedError         = ErrInfo{ErrCode: 10005, ErrMsg: "repeated error"}
)

Functions

func PlatformIDToClass

func PlatformIDToClass(num int) string

func PlatformIDToName

func PlatformIDToName(num int) string

func PlatformNameToClass

func PlatformNameToClass(name string) string

func PlatformNameToID

func PlatformNameToID(name string) int

Types

type ErrInfo

type ErrInfo struct {
	ErrCode int32
	ErrMsg  string
}

key = errCode, string = errMsg

func (*ErrInfo) Code

func (e *ErrInfo) Code() int32

func (ErrInfo) Error

func (e ErrInfo) Error() string

func (ErrInfo) ToString

func (e ErrInfo) ToString() error

Jump to

Keyboard shortcuts

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