sdk

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

* @Descripttion: * @version: * @Author: ran.ding * @Date: 2019-09-02 18:29:55 * @LastEditors: ran.ding * @LastEditTime: 2019-09-10 11:37:14

* @Descripttion: * @version: * @Author: ran.ding * @Date: 2019-09-02 18:29:55 * @LastEditors: ran.ding * @LastEditTime: 2019-09-10 11:22:38

Index

Constants

View Source
const (
	PRIVATE            ConversationType = iota + 1 // PRIVATE 二人会话
	DISCUSSION                                     // DISCUSSION 讨论组会话
	GROUP                                          // GROUP 群组会话
	CHATROOM                                       // CHATROOM 聊天室会话
	CUSTOM                                         // CUSTOM 客服会话
	SYSTEM                                         // SYSTEM 系统通知
	APP_PUBLIC_SERVICE                             // APP_PUBLIC_SERVICE 应用公众服务
	PUBLIC_SERVICE                                 // PUBLIC_SERVICE 公众服务
	ULTRA_GROUP                                    // ULTRA_GROUP 超级群服务

	ConversationTypePrivate ConversationType = 1  // ConversationTypePrivate 二人会话
	ConversationTypeGroup   ConversationType = 3  // ConversationTypeGroup 群组会话
	ConversationTypeSystem  ConversationType = 6  // ConversationTypeSystem 系统
	ConversationTypeUG      ConversationType = 10 // ConversationTypeUG 超级群

	ConversationUnPushLevelAllMessage        = -1 // ConversationUnPushLevelAllMessage 全部消息通知
	ConversationUnPushLevelNotSet            = 0  // ConversationUnPushLevelNotSet 未设置
	ConversationUnPushLevelAtMessage         = 1  // ConversationUnPushLevelAtMessage 仅@消息通知
	ConversationUnPushLevelAtUser            = 2  // ConversationUnPushLevelAtUser @指定用户通知
	ConversationUnPushLevelAtAllGroupMembers = 4  // ConversationUnPushLevelAtAllGroupMembers @群全员通知
	ConversationUnPushLevelNotRecv           = 5  // ConversationUnPushLevelNotRecv 不接收通知
)
View Source
const (
	MessagePrivateType = 1 // MessagePrivateType 二人会话
	MessageGroupType   = 3 // MessageGroupType 群组会话
)
View Source
const (
	// RONGCLOUDSMSURI 融云默认 SMS API 地址
	RONGCLOUDSMSURI = "http://api.sms.ronghub.com"
	// RONGCLOUDURI 融云默认 API 地址
	RONGCLOUDURI = "http://api.rong-api.com"
	// RONGCLOUDURI2 融云备用 API 地址
	RONGCLOUDURI2 = "http://api-b.rong-api.com"
	// ReqType body类型
	ReqType = "json"
	// USERAGENT sdk 名称
	USERAGENT = "rc-go-sdk/3.2.23"
	// DEFAULTTIMEOUT 默认超时时间,10秒
	DEFAULTTIMEOUT = 10
	// DEFAULT_KEEPALIVE http 默认保活时间,30秒
	DEFAULT_KEEPALIVE = 30
	// DEFAULT_MAXIDLECONNSPERHOST http 默认每个域名连接数,100
	DEFAULT_MAXIDLECONNSPERHOST = 100
	// 自动切换 api 地址时间间隔,秒
	DEFAULT_CHANGE_URI_DURATION = 30
)
View Source
const (
	UGUnPushLevelAllMessage        = -1 // UGUnPushLevelAllMessage 全部消息通知
	UGUnPushLevelNotSet            = 0  // UGUnPushLevelNotSet 未设置
	UGUnPushLevelAtMessage         = 1  // UGUnPushLevelAtMessage 仅@消息通知
	UGUnPushLevelAtUser            = 2  // UGUnPushLevelAtUser @指定用户通知
	UGUnPushLevelAtAllGroupMembers = 4  // UGUnPushLevelAtAllGroupMembers @群全员通知
	UGUnPushLevelNotRecv           = 5  // UGUnPushLevelNotRecv 不接收通知
)

Variables

This section is empty.

Functions

func RCErrorNew

func RCErrorNew(code int, text string) error

RCErrorNew 创建新的err信息

func RCErrorNewV2

func RCErrorNewV2(code int, text string) error

RCErrorNew 创建新的err信息

func WithKeepAlive

func WithKeepAlive(t time.Duration) rongCloudOption

WithKeepAlive 连接保活时间,最小单位为秒

func WithMaxIdleConnsPerHost

func WithMaxIdleConnsPerHost(n int) rongCloudOption

WithMaxIdleConnsPerHost 设置每个域名最大连接数

func WithRongCloudSMSURI

func WithRongCloudSMSURI(rongCloudSMSURI string) rongCloudOption

WithRongCloudSMSURI 设置融云 SMS URI

func WithRongCloudURI

func WithRongCloudURI(rongCloudURI string) rongCloudOption

WithRongCloudURI 设置融云 URI

func WithTimeout

func WithTimeout(t time.Duration) rongCloudOption

WithTimeout 设置超时时间,最小单位为秒

func WithTransport

func WithTransport(transport http.RoundTripper) rongCloudOption

Types

type AndroidPush

type AndroidPush struct {
	Alert          string `json:"alert,omitempty"`          // iOS 或 Android 不同平台下的推送消息内容,传入后默认的推送消息内容失效,不能为空。(非必传)
	Extras         Extras `json:"extras,omitempty"`         // Extras 请自行实现 Extras Interface,iOS 或 Android 不同平台下的附加信息,如果开发者自己需要,可以自己在 App 端进行解析, PushNotification 没有该字段(非必传)
	ChannelId      string `json:"channelId,omitempty"`      // ChannelId 渠道 ID,该条消息针对各厂商使用的推送渠道,目前支持的厂商包括:”MI” 小米、”HW” 华为、”OPPO”
	Importance     string `json:"importance,omitempty"`     // Importance 华为通知栏消息优先级,取值 NORMAL、LOW,默认为 NORMAL 重要消息
	Image          string `json:"image,omitempty"`          // Image 华为推送自定义的通知栏消息右侧大图标 URL,如果不设置,则不展示通知栏右侧图标。URL 使用的协议必须是 HTTPS 协议,取值样例:https://example.com/image.png。图标文件须小于 512KB,图标建议规格大小:40dp x 40dp,弧角大小为 8dp,超出建议规格大小的图标会存在图片压缩或显示不全的情况。
	LargeIconUri   string `json:"large_icon_uri,omitempty"` // LargeIconUri 小米推送自定义的通知栏消息右侧图标 URL,如果不设置,则不展示通知栏右侧图标。国内版仅 MIUI12 以上版本支持,以下版本均不支持;国际版支持。图片要求:大小120 * 120px,格式为 png 或者 jpg 格式。
	Classification string `json:"classification,omitempty"` // Classification vivo 推送通道类型。0 为运营消息、1 为系统消息,默认为你在开发者后台应用标识 vivo 推送中设置的推送通道类型。
}

AndroidPush 设置 Android 平台下的推送及附加信息。

type Audience

type Audience struct {
	Tag         []string `json:"tag,omitempty"`    // 用户标签,每次发送时最多发送 20 个标签,标签之间为 AND 的关系,is_to_all 为 true 时参数无效。(非必传)
	TagOr       []string `json:"tag_or,omitempty"` // 用户标签,每次发送时最多发送 20 个标签,标签之间为 OR 的关系,is_to_all 为 true 时参数无效,tag_or 同 tag 参数可以同时存在。(非必传)
	UserID      []string `json:"userid,omitempty"` // 用户 Id,每次发送时最多发送 1000 个用户,如果 tag 和 userid 两个条件同时存在时,则以 userid 为准,如果 userid 有值时,则 platform 参数无效,is_to_all 为 true 时参数无效。(非必传)
	IsToAll     bool     `json:"is_to_all"`        // 是否全部推送,false 表示按 tag 、tag_or 或 userid 条件推送,true 表示向所有用户推送,tag、tag_or 和 userid 条件无效。(必传)
	PackageName string   `json:"packageName"`      // 应用包名,is_to_all 为 true 时,此参数无效。与 tag、tag_or 同时存在时为 And 的关系,向同时满足条件的用户推送。与 userid 条件同时存在时,以 userid 为准进行推送。(非必传)
}

Audience 推送条件。

type BlacklistResult

type BlacklistResult struct {
	Users []string `json:"users"`
}

BlacklistResult 返回信息

type BlockListResult

type BlockListResult struct {
	Users []User `json:"users"`
}

BlockListResult 返回信息

type Broadcast

type Broadcast struct {
	PlatForm     []PlatForm   `json:"platform"`               // 目标操作系统,iOS、Android 最少传递一个。如果需要给两个系统推送消息时,则需要全部填写。(必传)
	FromUserID   string       `json:"fromuserid"`             // 发送人用户 Id。 (必传)
	Message      Message      `json:"message"`                // 广播消息。(必传)
	Audience     Audience     `json:"audience"`               // 推送条件,包括:tag 、userid 、packageName 、 is_to_all。(必传)
	Notification Notification `json:"notification,omitempty"` // 按操作系统类型推送消息内容,如 platform 中设置了给 iOS 和 Android 系统推送消息,而在 notification 中只设置了 iOS 的推送内容,则 Android 的推送内容为最初 alert 设置的内容。(非必传)
}

Broadcast 广播消息

type BroadcastRecallContent

type BroadcastRecallContent struct {
	MessageId        string `json:"messageUId"`
	ConversationType int    `json:"conversationType"`
	IsAdmin          int    `json:"isAdmin"`
	IsDelete         int    `json:"isDelete"`
}

BroadcastRecallContent content of message broadcast recall

func (*BroadcastRecallContent) ToString

func (content *BroadcastRecallContent) ToString() (string, error)

*

  • @name: ToString
  • @test:
  • @msg: 将广播消息撤回接口需要的 content 结构体参数转换为 json
  • @param {type}
  • @return: string error

type CMDMsg

type CMDMsg struct {
	Name string      `json:"name"`
	Data string      `json:"data"`
	User MsgUserInfo `json:"user"`
}

CMDMsg 消息

func (*CMDMsg) ToString

func (msg *CMDMsg) ToString() (string, error)

ToString CMDMsg

type CMDNtf

type CMDNtf struct {
	Name string      `json:"operation"`
	Data string      `json:"data"`
	User MsgUserInfo `json:"user"`
}

CMDNtf 消息

func (*CMDNtf) ToString

func (msg *CMDNtf) ToString() (string, error)

ToString CMDNtf

type ChatRoom

type ChatRoom struct {
	ChatRoomID string `json:"chrmId"`
	Name       string `json:"name"`
	Time       string `json:"time"`
}

ChatRoom 聊天室信息

type ChatRoomAttr

type ChatRoomAttr struct {
	Key         string `json:"key"`
	Value       string `json:"value"`
	UserID      string `json:"userID"`
	AutoDelete  string `json:"autoDelete"`
	LastSetTime string `json:"lastSetTime"`
}

ChatRoomAttr 聊天室属性自定义结构

type ChatRoomAttrResult

type ChatRoomAttrResult struct {
	Keys []ChatRoomAttr `json:"keys"`
}

ChatRoomAttrResult 聊天室属性自定义返回结果

type ChatRoomGetResult

type ChatRoomGetResult struct {
	Code        int    `json:"code"`
	ChatroomId  string `json:"chatroomId"`
	CreateTime  int64  `json:"createTime"`
	MemberCount int    `json:"memberCount"`
	DestroyType int    `json:"destroyType"`
	DestroyTime int    `json:"destroyTime"`
	IsBan       bool   `json:"ban"`
}

查询聊天室信息返回结果

type ChatRoomInfo

type ChatRoomInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

ChatRoomInfo 聊天室信息

type ChatRoomKVNotiMessage

type ChatRoomKVNotiMessage struct {
	Type  int    `json:"type"`
	Key   string `json:"string"`
	Value string `json:"value"`
	Extra string `json:"extra"`
}

ChatRoomKVNotiMessage 聊天室属性通知消息

func (*ChatRoomKVNotiMessage) ToString

func (msg *ChatRoomKVNotiMessage) ToString() (string, error)

ToString ChatRoomKVNotiMessage

type ChatRoomQueryResult

type ChatRoomQueryResult struct {
	ChatRooms []ChatRoom `json:"chatRooms"`
}

ChatRoomQueryResult 聊天室查询接口返回数据

type ChatRoomResult

type ChatRoomResult struct {
	Total            int            `json:"total"`
	Users            []ChatRoomUser `json:"users"`
	Result           []ChatRoomUser `json:"result"`
	ObjectNames      []string       `json:"objectNames"`
	ChatRoomIDs      []string       `json:"chatroomids"`
	WhitelistMsgType []string       `json:"whitlistMsgType"`
}

ChatRoomResult ChatRoom 返回结果

type ChatRoomUser

type ChatRoomUser struct {
	ID       string `json:"id"`
	UserID   string `json:"userId"`
	Time     string `json:"time"`
	IsInChrm int    `json:"isInChrm"`
}

ChatRoomUser 聊天室用户信息

type ChatUserExistObj

type ChatUserExistObj struct {
	// 200:成功。
	Code int `json:"code"`

	// 用户是否在聊天室中,true 表示在聊天室中,false 表示不在聊天室中。
	IsInChrm bool `json:"isInChrm"`
}

ChatUserExistObj : ChatUserExistResObj的返回值

type ChatroomOption

type ChatroomOption func(*chatroomOptions)

ChatroomOption 接口函数

func WithChatroomDestroyTime

func WithChatroomDestroyTime(destroyTime int) ChatroomOption

设置聊天室销毁时间, destroyType=1时生效,单位为分钟,最小值 60 分钟,最大 10080 分钟(7 天)。如果未设置,默认 60 分钟。

func WithChatroomDestroyType

func WithChatroomDestroyType(destroyType int) ChatroomOption

指定聊天室的销毁类型: 0:默认值,表示不活跃时销毁, 1:固定时间销毁

func WithChatroomEntryInfo

func WithChatroomEntryInfo(entryInfo map[string]interface{}) ChatroomOption

聊天室自定义属性 KV 对,JSON 结构

func WithChatroomEntryOwnerId

func WithChatroomEntryOwnerId(entryOwnerId string) ChatroomOption

聊天室自定义属性的所属用户 ID

func WithChatroomExtra

func WithChatroomExtra(extra string) ChatroomOption

通知携带的 JSON 格式的扩展信息,仅在 needNotify 为 true 时有效。

func WithChatroomIsBan

func WithChatroomIsBan(isBan bool) ChatroomOption

是否禁言聊天室全体成员,默认 false

func WithChatroomNeedNotify

func WithChatroomNeedNotify(isNeedNotify bool) ChatroomOption

是否通知成员。默认 false 不通知

func WithChatroomWhiteUserIds

func WithChatroomWhiteUserIds(whiteUserIds []string) ChatroomOption

禁言白名单用户列表,支持批量设置,最多不超过 20 个

type CodeResult

type CodeResult struct {
	Code         int    `json:"code"`         // 返回码,200 为正常。
	ErrorMessage string `json:"errorMessage"` // 错误信息
}

CodeResult 融云返回状态码和错误码

func (CodeResult) Error

func (e CodeResult) Error() string

Error 获取错误信息

func (CodeResult) ErrorCode

func (e CodeResult) ErrorCode() int

ErrorCode 获取错误码

type CodeResultV2

type CodeResultV2 struct {
	Code    int    `json:"code"` // 返回码,10000 为正常。
	Message string `json:"msg"`  // 错误信息
}

func (CodeResultV2) Error

func (e CodeResultV2) Error() string

Error 获取错误信息

func (CodeResultV2) ErrorCode

func (e CodeResultV2) ErrorCode() int

ErrorCode 获取错误码

type ContactNtf

type ContactNtf struct {
	Operation    string      `json:"operation"`
	SourceUserID string      `json:"sourceUserId"`
	TargetUserID string      `json:"targetUserId"`
	Message      string      `json:"message"`
	Extra        string      `json:"extra"`
	User         MsgUserInfo `json:"user"`
}

ContactNtf 消息

func (*ContactNtf) ToString

func (msg *ContactNtf) ToString() (string, error)

ToString ContactNtf

type ConversationType

type ConversationType int

ConversationType 会话类型

type DizNtf

type DizNtf struct {
	Type      int         `json:"type"`
	Extension string      `json:"extension"`
	Operation string      `json:"operation"`
	User      MsgUserInfo `json:"user"`
}

DizNtf 消息

func (*DizNtf) ToString

func (msg *DizNtf) ToString() (string, error)

ToString DizNtf

type Extras

type Extras interface {
	ToJSON() ([]byte, error)
}

Extras 请自行实现 IOSBroadcast AndroidBroadcast 中 Extras 接口

type FileMsg

type FileMsg struct {
	Name    string      `json:"name"`
	Size    string      `json:"size"`
	Type    string      `json:"type"`
	FileURL string      `json:"fileUrl"`
	User    MsgUserInfo `json:"user"`
}

FileMsg 消息

func (*FileMsg) ToString

func (msg *FileMsg) ToString() (string, error)

ToString FileMsg

type Group

type Group struct {
	ID    string      `json:"id"`
	Users []GroupUser `json:"users"`
	Name  string      `json:"name"`
	Stat  string      `json:"stat"`
}

Group 群组信息

type GroupInfo

type GroupInfo struct {
	GroupInfo []Group `json:"groupinfo"`
}

GroupInfo 群组信息

type GroupRemarksGetObj

type GroupRemarksGetObj struct {
	// 返回码,200 为正常。
	Code int `json:"code"`

	// 备注名称
	Remark string `json:"remark"`
}

type GroupUser

type GroupUser struct {
	ID     string `json:"id"`
	UserID string `json:"userId"`
	Time   string `json:"time"`
}

GroupUser 群组用户信息

type GroupUserQueryGroup

type GroupUserQueryGroup struct {
	// 群名称。
	Name string `json:"name"`

	// 群组 ID。
	Id string `json:"id"`
}

type GroupUserQueryObj

type GroupUserQueryObj struct {
	// 返回码,200 为正常
	Code int `json:"code"`

	// 用户加入的群信息数组。
	Groups []GroupUserQueryGroup `json:"groups"`
}

GroupUserQueryObj : GroupUserQueryResObj 的返回值

type GrpNtf

type GrpNtf struct {
	OperatorUserID string      `json:"operatorUserId"`
	Operation      string      `json:"operation"`
	Data           string      `json:"data"`
	Message        string      `json:"message"`
	Extra          string      `json:"extra"`
	User           MsgUserInfo `json:"user"`
}

GrpNtf 消息

func (*GrpNtf) ToString

func (msg *GrpNtf) ToString() (string, error)

ToString GrpNtf

type HQVCMsg

type HQVCMsg struct {
	LocalPath string      `json:"localPath"`
	RemoteUrl string      `json:"remoteUrl"`
	Duration  interface{} `json:"duration"`
	User      MsgUserInfo `json:"user"`
	Extra     string      `json:"extra"`
}

高清语音消息 RC:HQVCMsg

func (*HQVCMsg) ToString

func (msg *HQVCMsg) ToString() (string, error)

ToString HQVCMsg

type History

type History struct {
	URL string `json:"url"`
}

History History

type IMGTextMsg

type IMGTextMsg struct {
	Title    string      `json:"title"`
	Content  string      `json:"content"`
	User     MsgUserInfo `json:"user"`
	Extra    string      `json:"extra"`
	ImageUri string      `json:"imageUri"`
	URL      string      `json:"url"`
}

IMGTextMsg 消息

func (*IMGTextMsg) ToString

func (msg *IMGTextMsg) ToString() (string, error)

ToString IMGTextMsg

type IOSPush

type IOSPush struct {
	Title            string `json:"title,omitempty"`            // 通知栏显示的推送标题,仅针对 iOS 平台,支持 iOS 8.2 及以上版本,参数在 ios 节点下设置,详细可参考“设置 iOS 推送标题请求示例”。(非必传)
	ContentAvailable int    `json:"contentAvailable,omitempty"` // 针对 iOS 平台,静默推送是 iOS7 之后推出的一种推送方式。 允许应用在收到通知后在后台运行一段代码,且能够马上执行。1 表示为开启,0 表示为关闭,默认为 0(非必传)
	Alert            string `json:"alert,omitempty"`            // iOS 或 Android 不同平台下的推送消息内容,传入后默认的推送消息内容失效,不能为空。(非必传)
	Extras           Extras `json:"extras,omitempty"`           // Extras 请自行实现 Extras Interface,iOS 或 Android 不同平台下的附加信息,如果开发者自己需要,可以自己在 App 端进行解析。(非必传)
	Badge            int    `json:"badge,omitempty"`            // 应用角标,仅针对 iOS 平台;不填时,表示不改变角标数;为 0 或负数时,表示 App 角标上的数字清零;否则传相应数字表示把角标数改为指定的数字,最大不超过 9999,参数在 ios 节点下设置,详细可参考“设置 iOS 角标数 HTTP 请求示例”。(非必传)
	Category         string `json:"category,omitempty"`         // iOS 富文本推送的类型开发者自已定义,自已在 App 端进行解析判断,与 richMediaUri 一起使用。(非必传)
	RichMediaURI     string `json:"richMediaUri,omitempty"`     // iOS 富文本推送内容的 URL,与 category 一起使用。(非必传)
	ThreadId         string `json:"threadId,omitempty"`         // ThreadId iOS 平台通知栏分组 ID,相同的 thread-id 推送分一组,单组超过 5 条推送会折叠展示
	ApnsCollapseId   string `json:"apns-collapse-id,omitempty"` // ApnsCollapseId iOS 平台,从 iOS10 开始支持,设置后设备收到有相同 ID 的消息,会合并成一条
}

IOSPush 设置 iOS 平台下的推送及附加信息。

type ImgMsg

type ImgMsg struct {
	Content  string      `json:"content"`
	User     MsgUserInfo `json:"user"`
	ImageURI string      `json:"imageUri"`
	Extra    string      `json:"extra"`
}

ImgMsg 消息

func (*ImgMsg) ToString

func (msg *ImgMsg) ToString() (string, error)

ToString ImgMsg

type InfoNtf

type InfoNtf struct {
	Message string      `json:"message"`
	User    MsgUserInfo `json:"user"`
	Extra   string      `json:"extra"`
}

InfoNtf 消息

func (*InfoNtf) ToString

func (msg *InfoNtf) ToString() (string, error)

ToString InfoNtf

type LBSMsg

type LBSMsg struct {
	Content   string      `json:"content"`
	Extra     string      `json:"extra"`
	POI       string      `json:"poi"`
	Latitude  float64     `json:"latitude"`
	Longitude float64     `json:"longitude"`
	User      MsgUserInfo `json:"user"`
}

LBSMsg 消息

func (*LBSMsg) ToString

func (msg *LBSMsg) ToString() (string, error)

ToString LBSMsg

type ListWordFilterResult

type ListWordFilterResult struct {
	Words []SensitiveWord `json:"words"`
}

ListWordFilterResult listWordFilter返回结果

type MentionMsgContent

type MentionMsgContent struct {
	Content       string        `json:"content"`
	MentionedInfo MentionedInfo `json:"mentionedInfo"`
}

MentionMsgContent MentionMsgContent

type MentionedInfo

type MentionedInfo struct {
	Type        int      `json:"type"`
	UserIDs     []string `json:"userIdList"`
	PushContent string   `json:"mentionedContent"`
}

MentionedInfo Mentioned

type Message

type Message struct {
	Content    string `json:"content"`    // 融云的内置消息,请务必参考 RCMsg Interface 。自定义消息请,自行实现 RCMsg Interface 转换成 String 传入
	ObjectName string `json:"objectName"` // 融云的内置消息,自定义消息
}

Message 广播消息内容

type MessageExpansionItem

type MessageExpansionItem struct {
	Key       string `json:"key"`
	Value     string `json:"value"`
	Timestamp int64  `json:"timestamp"`
}

type MsgOption

type MsgOption func(*msgOptions)

MsgOption 接口函数

func WithExtraContent

func WithExtraContent(extraContent string) MsgOption

WithExtraContent 自定义的消息扩展信息,该字段接受 JSON 字符串格式的键值对(key-value pairs)。

func WithIsAdmin

func WithIsAdmin(isAdmin int) MsgOption

是否为管理员,默认为 0,设为 1 时,IMKit 收到此条消息后,小灰条默认显示为“管理员 撤回了一条消息”。

func WithIsDelete

func WithIsDelete(isDelete int) MsgOption

默认为 0 撤回该条消息同时,用户端将该条消息删除并替换为一条小灰条撤回提示消息;为 1 时,该条消息删除后,不替换为小灰条提示消息。

func WithMsgBusChannel

func WithMsgBusChannel(busChannel string) MsgOption

busChannel 创建子会话

func WithMsgContentAvailable

func WithMsgContentAvailable(contentAvailable int) MsgOption

针对 iOS 平台,对 SDK 处于后台暂停状态时为静默推送 iOS7 之后推出的一种推送方式。 允许应用在收到通知后在后台运行一段代码,且能够马上执行 1 表示为开启,0 表示为关闭,默认为 0

func WithMsgDisablePush

func WithMsgDisablePush(isDisablePush bool) MsgOption

disablePush Boolean 是否为静默消息,默认为 false,设为 true 时终端用户离线情况下不会收到通知提醒。

func WithMsgExpansion

func WithMsgExpansion(isExpansion bool) MsgOption

是否为可扩展消息,默认为 false,设为 true 时终端在收到该条消息后,可对该条消息设置扩展信息。

func WithMsgIsCounted

func WithMsgIsCounted(isCounted int) MsgOption

WithMsgIsCounted 用户未在线时是否计入未读消息数。0 表示为不计数、1 表示为计数,默认为 1

func WithMsgMentioned

func WithMsgMentioned(isMentioned int) MsgOption

是否为 @消息,0 表示为普通消息,1 表示为 @消息,默认为 0

func WithMsgPushContent

func WithMsgPushContent(pushContent string) MsgOption

pushContent String 定义显示的 Push 内容,如果 objectName 为融云内置消息类型时,则发送后用户一定会收到 Push 信息。 如果为自定义消息,则 pushContent 为自定义消息显示的 Push 内容,如果不传则用户不会收到 Push 通知。

func WithMsgPushData

func WithMsgPushData(pushData string) MsgOption

pushData String 针对 iOS 平台为 Push 通知时附加到 payload 中,客户端获取远程推送内容时为 appData, 同时融云默认携带了消息基本信息,客户端可通过 'rc' 属性获取,Android 客户端收到推送消息时对应字段名为 pushData。

func WithMsgPushExt

func WithMsgPushExt(pushExt string) MsgOption

pushExt String 推送通知属性设置,详细查看 pushExt 结构说明,pushExt 为 JSON 结构请求时需要做转义处理。 disablePush 为 true 时此属性无效。

func WithMsgVerifyBlacklist

func WithMsgVerifyBlacklist(verifyBlacklist int) MsgOption

是否过滤发送人黑名单列表,0 为不过滤、 1 为过滤,默认为 0 不过滤。

type MsgUserInfo

type MsgUserInfo struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Icon     string `json:"icon"`
	Portrait string `json:"portrait"`
	Extra    string `json:"extra"`
}

MsgUserInfo 融云内置消息用户信息

type Notification

type Notification struct {
	Alert   string      `json:"alert"`             // 默认推送消息内容,如填写了 iOS 或 Android 下的 alert 时,则推送内容以对应平台系统的 alert 为准。(必传)
	IOS     IOSPush     `json:"ios,omitempty"`     // 设置 iOS 平台下的推送及附加信息。
	Android AndroidPush `json:"android,omitempty"` // 设置 Android 平台下的推送及附加信息。
}

Notification 按操作系统类型推送消息内容,如 platform 中设置了给 iOS 和 Android 系统推送消息,而在 notification 中只设置了 iOS 的推送内容,则 Android 的推送内容为最初 alert 设置的内容。(必传)

type PlatForm

type PlatForm string

PlatForm 广播类型

const (
	// IOSPlatForm 广播
	IOSPlatForm PlatForm = "ios"
	// AndroidPlatForm 广播
	AndroidPlatForm PlatForm = "android"
)

type ProfileNtf

type ProfileNtf struct {
	Operation string      `json:"operation"`
	Data      string      `json:"data"`
	User      MsgUserInfo `json:"user"`
	Extra     string      `json:"extra"`
}

ProfileNtf 消息

func (*ProfileNtf) ToString

func (msg *ProfileNtf) ToString() (string, error)

ToString ProfileNtf

type Push

type Push struct {
	PlatForm     []PlatForm   `json:"platform"`     // 目标操作系统,iOS、Android 最少传递一个。如果需要给两个系统推送消息时,则需要全部填写。(必传)
	Audience     Audience     `json:"audience"`     // 推送条件,包括:tag 、userid 、packageName 、 is_to_all。(必传)
	Notification Notification `json:"notification"` // 按操作系统类型推送消息内容,如 platform 中设置了给 iOS 和 Android 系统推送消息,而在 notification 中只设置了 iOS 的推送内容,则 Android 的推送内容为最初 alert 设置的内容。(必传)
}

Push 广播推送

type PushCustomData

type PushCustomData struct {
	Platform []string `json:"platform"`
	Audience struct {
		Tag      []string `json:"tag"`
		TagOr    []string `json:"tag_or"`
		Packages string   `json:"packageName"`
		TagItems []struct {
			Tags          []string `json:"tags"`
			IsNot         bool     `json:"isNot"`
			TagsOperator  string   `json:"tagsOperator"`
			ItemsOperator string   `json:"itemsOperator"`
		} `json:"tagItems,omitempty"`
		IsToAll bool `json:"is_to_all"`
	} `json:"audience"`
	Notification struct {
		Title string `json:"title"`
		Alert string `json:"alert"`
		Ios   struct {
			Title            string      `json:"title,omitempty"`
			ContentAvailable int         `json:"contentAvailable"`
			Badge            int         `json:"badge,omitempty"`
			ThreadId         string      `json:"thread-id"`
			ApnsCollapseId   string      `json:"apns-collapse-id"`
			Category         string      `json:"category,omitempty"`
			RichMediaUri     string      `json:"richMediaUri,omitempty"`
			Extras           interface{} `json:"extras"`
		} `json:"ios"`
		Android struct {
			Hw struct {
				ChannelId  string `json:"channelId"`
				Importance string `json:"importance"`
				Image      string `json:"image"`
			} `json:"hw"`
			Mi struct {
				ChannelId    string `json:"channelId"`
				LargeIconUri string `json:"large_icon_uri"`
			} `json:"mi"`
			Oppo struct {
				ChannelId string `json:"channelId"`
			} `json:"oppo"`
			Vivo struct {
				Classification string `json:"classification"`
			} `json:"vivo"`
			Extras struct {
				Id   string `json:"id"`
				Name string `json:"name"`
			} `json:"extras"`
		} `json:"android"`
	} `json:"notification"`
}

type PushCustomObj

type PushCustomObj struct {
	// 返回码,200 为正常。
	Code int `json:"code"`

	// 推送唯一标识。
	Id string `json:"id"`
}

PushCustomObj :PushCustomResObj方法的返回值

type PushExt

type PushExt struct {
	Title                string                         `json:"title,omitempty"`
	TemplateId           string                         `json:"templateId,omitempty"`
	ForceShowPushContent int                            `json:"forceShowPushContent,omitempty"`
	PushConfigs          []map[string]map[string]string `json:"pushConfigs,omitempty"`
}

type PushNotification

type PushNotification struct {
	Title       string                 `json:"title,omitempty"`   // Title 通知栏显示标题,最长不超过 50 个字符。
	PushContent string                 `json:"pushContent"`       // PushContent 推送消息内容。
	IOS         IOSPush                `json:"ios,omitempty"`     // IOS 设置 iOS 平台下的推送及附加信息,详细查看 ios 结构说明。
	Android     map[string]interface{} `json:"android,omitempty"` // Android 设置 Android 平台下的推送及附加信息,详细查看 android 结构说明。
}

type PushPeriodGet

type PushPeriodGet struct {
	Code int `json:"code"`
	Data struct {
		StartTime string `json:"startTime"`
		Period    int    `json:"period"`
		Level     int    `json:"unPushLevel"`
	}
}

type PushResult

type PushResult struct {
	*CodeResult
	ID string `json:"id"`
}

PushResult Send 函数返回

type RespDataArray

type RespDataArray struct {
	Code int                                 `json:"code"`
	Data map[string][]map[string]interface{} `json:"data"`
}

api 返回结果, data 数组

type RespDataKV

type RespDataKV struct {
	Code int                    `json:"code"`
	Data map[string]interface{} `json:"data"`
}

api 返回结果, data

type RongCloud

type RongCloud struct {
	// contains filtered or unexported fields
}

RongCloud appKey appSecret extra

func GetRongCloud

func GetRongCloud() *RongCloud

GetRongCloud 获取 RongCloud 对象

func NewRongCloud

func NewRongCloud(appKey, appSecret string, options ...rongCloudOption) *RongCloud

NewRongCloud 创建 RongCloud 对象

func (*RongCloud) AddWhiteList

func (rc *RongCloud) AddWhiteList(userId string, whiteList []string) error

*

  • @name: AddWhiteList
  • @test:
  • @msg: 添加用户到白名单(每秒限 100 次)
  • @param string userId
  • @param []string whiteList
  • @return: error

func (*RongCloud) BlacklistAdd

func (rc *RongCloud) BlacklistAdd(id string, blacklist []string) error

BlacklistAdd 添加用户到黑名单方法(每秒钟限 100 次)

*@param id:用户 ID。 *@param blacklist:被设置为黑名单的用户列表。 * *@return error

func (*RongCloud) BlacklistGet

func (rc *RongCloud) BlacklistGet(id string) (BlacklistResult, error)

BlacklistGet 获取某用户的黑名单列表方法(每秒钟限 100 次)

*@param id:用户 ID。 * *@return BlacklistResult error

func (*RongCloud) BlacklistRemove

func (rc *RongCloud) BlacklistRemove(id string, blacklist []string) error

BlacklistRemove 从黑名单中移除用户方法(每秒钟限 100 次)

*@param id:用户 ID。 *@param blacklist:被移除黑名单列表。 * *@return error

func (*RongCloud) BlockAdd

func (rc *RongCloud) BlockAdd(id string, minute uint64) error

BlockAdd 添加用户到黑名单

*@param id:用户 ID。 *@param minute:封禁时长 1 - 1 * 30 * 24 * 60 分钟,最大值为 43200 分钟 * *@return error

func (*RongCloud) BlockGetList

func (rc *RongCloud) BlockGetList() (BlockListResult, error)

BlockGetList 获取某用户的黑名单列表

*@return QueryBlockUserResult error

func (*RongCloud) BlockRemove

func (rc *RongCloud) BlockRemove(id string) error

BlockRemove 从黑名单中移除用户

*@param id:用户 ID。 * *@return error

func (*RongCloud) ChangeURI

func (rc *RongCloud) ChangeURI()

changeURI 自动切换 Api 服务器地址 在 api、api2之间自动切换。无法切换其他域名。其他请使用 PrivateURI 设置

func (*RongCloud) ChatRoomBan

func (rc *RongCloud) ChatRoomBan(chatroomId string, options ...ChatroomOption) error

设置聊天室全体禁言

func (*RongCloud) ChatRoomBanAdd

func (rc *RongCloud) ChatRoomBanAdd(members []string, minute uint, options ...ChatroomOption) error

ChatRoomBanAdd 添加聊天室全局禁言

*@param  members:成员列表,最多不超过 20 个。
*@param  minute:禁言时长,范围: 1 - 1 * 30 * 24 * 60 分钟。
*
*@return error

func (*RongCloud) ChatRoomBanCheck

func (rc *RongCloud) ChatRoomBanCheck(chatroomId string) (bool, error)

查询聊天室全体禁言状态

func (*RongCloud) ChatRoomBanGetList

func (rc *RongCloud) ChatRoomBanGetList() ([]ChatRoomUser, error)

ChatRoomBanGetList 获取聊天室全局禁言列表

*@return []ChatRoomUser error

func (*RongCloud) ChatRoomBanQuery

func (rc *RongCloud) ChatRoomBanQuery(size, page int) ([]string, error)

查询聊天室全体禁言列表

func (*RongCloud) ChatRoomBanRemove

func (rc *RongCloud) ChatRoomBanRemove(members []string, options ...ChatroomOption) error

ChatRoomBanRemove 解除聊天室全局禁言

*@param  members:成员列表,最多不超过 20 个。
*
*@return error

func (*RongCloud) ChatRoomBanRollback

func (rc *RongCloud) ChatRoomBanRollback(chatroomId string, options ...ChatroomOption) error

取消聊天室全体禁言

func (*RongCloud) ChatRoomBlockAdd

func (rc *RongCloud) ChatRoomBlockAdd(id string, members []string, minute uint, options ...ChatroomOption) error

ChatRoomBlockAdd 添加封禁聊天室成员方法 *

*
*@param  id:聊天室 Id。
*@param  members:封禁列表。
*@param  minute:封禁时长,以分钟为单位,最大值为43200分钟。
*
*@return error

func (*RongCloud) ChatRoomBlockGetList

func (rc *RongCloud) ChatRoomBlockGetList(id string) (ChatRoomResult, error)

ChatRoomBlockGetList 查询被封禁聊天室成员方法

*@param  id:聊天室 ID。
*
*@return ChatRoomResult error

func (*RongCloud) ChatRoomBlockRemove

func (rc *RongCloud) ChatRoomBlockRemove(id string, members []string, options ...ChatroomOption) error

ChatRoomBlockRemove 移除封禁聊天室成员方法

*
*@param  id:聊天室 ID。
*@param  members: 用户列表。
*
*@return error

func (*RongCloud) ChatRoomBroadcast

func (rc *RongCloud) ChatRoomBroadcast(senderID, objectName string, msg rcMsg, isIncludeSender ...string) error

ChatRoomBroadcast 向应用内所有聊天室广播消息方法,此功能需开通 专属服务(以一个用户身份向群组发送消息,单条消息最大 128k.每秒钟最多发送 20 条消息。)

*@param senderID:发送人用户 ID 。 *@param objectName:消息类型 *@param msg:发送消息内容 * @param isIncludeSender:0或者1 *@return error

func (*RongCloud) ChatRoomCreate

func (rc *RongCloud) ChatRoomCreate(id, name string) error

ChatRoomCreate 创建聊天室方法

*@param  id:要创建的聊天室的ID;
*@param  name:要创建的聊天室的name。
*
*@return error

func (*RongCloud) ChatRoomCreateNew

func (rc *RongCloud) ChatRoomCreateNew(chatroomId string, options ...ChatroomOption) error

创建聊天室

func (*RongCloud) ChatRoomDemotionAdd

func (rc *RongCloud) ChatRoomDemotionAdd(objectNames []string) error

ChatRoomDemotionAdd 添加聊天室消息优先级方法

*@param  objectName:消息类型列表,最多 20 个。
*@return err

func (*RongCloud) ChatRoomDemotionGetList

func (rc *RongCloud) ChatRoomDemotionGetList() ([]string, error)

ChatRoomDemotionGetList 获取应用内聊天室降级消息

*@return []string error

func (*RongCloud) ChatRoomDemotionRemove

func (rc *RongCloud) ChatRoomDemotionRemove(objectNames []string) error

ChatRoomDemotionRemove 移除应用内聊天室降级消息

*@param  objectName:消息类型列表。
*@return err

func (*RongCloud) ChatRoomDestroy

func (rc *RongCloud) ChatRoomDestroy(id string) error

ChatRoomDestroy 销毁聊天室方法 *

*
*@param  id:要销毁的聊天室 ID。
*
*@return error

func (*RongCloud) ChatRoomDestroySet

func (rc *RongCloud) ChatRoomDestroySet(chatroomId string, destroyType, destroyTime int) error

设置聊天室销毁类型

func (*RongCloud) ChatRoomDistributionResume

func (rc *RongCloud) ChatRoomDistributionResume(id string) error

ChatRoomDistributionResume 聊天室消息恢复分发方法

*@param  id:聊天室 ID。
*@return error

func (*RongCloud) ChatRoomDistributionStop

func (rc *RongCloud) ChatRoomDistributionStop(id string) error

ChatRoomDistributionStop 聊天室消息停止分发方法(可实现控制对聊天室中消息是否进行分发,停止分发后聊天室中用户发送的消息,融云服务端不会再将消息发送给聊天室中其他用户。)

*@param  id:聊天室 ID。
*@return error

func (*RongCloud) ChatRoomEntryBatchSet

func (rc *RongCloud) ChatRoomEntryBatchSet(chatroomId string, autoDelete int, entryOwnerId string, entryInfo map[string]interface{}) error

批量设置聊天室属性(KV)

func (*RongCloud) ChatRoomEntryQuery

func (rc *RongCloud) ChatRoomEntryQuery(chatRoomID string, keys ...string) ([]ChatRoomAttr, error)

ChatRoomEntryQuery 获取聊天室属性自定义 *

  • @param ChatRoomID 聊天室 Id
  • @param keys 批量获取指定聊天室中的 Key 值,最多上限为 100 个,为空时获取全部 key 值。 *
  • @return []ChatRoomAttr 属性列表
  • @return error 错误

func (*RongCloud) ChatRoomEntryRemove

func (rc *RongCloud) ChatRoomEntryRemove(chatRoomID, userID, key string) error

ChatRoomEntryRemove 删除聊天室自定义属性 *

  • @param chatRoomID 聊天室 Id
  • @param userID 操作用户 Id。通过 Server API 非聊天室中用户可以进行设置。
  • @param key 聊天室属性名称,Key 支持大小写英文字母、数字、部分特殊符号 + = - _ 的组合方式,大小写敏感。最大长度 128 字 *
  • @return error

func (*RongCloud) ChatRoomEntrySet

func (rc *RongCloud) ChatRoomEntrySet(chatRoomID, userID, key, value string, autoDelete bool) error

ChatRoomEntrySet 设置聊天室自定义属性 *

  • @param chatRoomID 聊天室 Id
  • @param userID 操作用户 Id。通过 Server API 非聊天室中用户可以进行设置。
  • @param key 聊天室属性名称,Key 支持大小写英文字母、数字、部分特殊符号 + = - _ 的组合方式,大小写敏感。最大长度 128 字符
  • @param value 聊天室属性对应的值,最大长度 4096 个字符
  • @param autoDelete 用户退出聊天室后,是否删除此 Key 值。为 true 时删除此 Key 值,为 false 时用户退出后不删除此 Key *
  • @retrun error

func (*RongCloud) ChatRoomGagAdd

func (rc *RongCloud) ChatRoomGagAdd(id string, members []string, minute uint, options ...ChatroomOption) error

ChatRoomGagAdd 添加禁言聊天室成员方法(在 App 中如果不想让某一用户在聊天室中发言时,可将此用户在聊天室中禁言,被禁言用户可以接收查看聊天室中用户聊天信息,但不能发送消息.)

*
*@param  id:聊天室 ID。
*@param  members:禁言列表。
*@param  minute:禁言时长,以分钟为单位,最大值为43200分钟。(必传)
*
*@return error

func (*RongCloud) ChatRoomGagGetList

func (rc *RongCloud) ChatRoomGagGetList(id string) ([]ChatRoomUser, error)

ChatRoomGagGetList 查询被禁言聊天室成员方法

*@param  id:聊天室 ID。(必传)
*
*@return []ChatRoomUser error

func (*RongCloud) ChatRoomGagRemove

func (rc *RongCloud) ChatRoomGagRemove(id string, members []string, options ...ChatroomOption) error

ChatRoomGagRemove 移除禁言聊天室成员方法

*@param  id:聊天室Id。
*@param  members:解除禁言列表
*
*@return error

func (*RongCloud) ChatRoomGet

func (rc *RongCloud) ChatRoomGet(id string, count, order int) (ChatRoomResult, error)

ChatRoomGet 查询聊天室内用户方法

*@param  id:要查询的聊天室 ID。
*@param  count:要获取的聊天室成员数,上限为 500 ,超过 500 时最多返回 500 个成员。
*@param  order:加入聊天室的先后顺序, 1 为加入时间正序, 2 为加入时间倒序。
*
*@return ChatRoomResult error

func (*RongCloud) ChatRoomGetNew

func (rc *RongCloud) ChatRoomGetNew(chatroomId string) (ChatRoomGetResult, error)

查询聊天室信息

func (*RongCloud) ChatRoomIsExist

func (rc *RongCloud) ChatRoomIsExist(id string, members []string) ([]ChatRoomUser, error)

ChatRoomIsExist 检查用户是否在聊天室

*@param  id:要查询的聊天室 ID。
*@param  members:每次最多 1000 个成员。
*
*@return ChatRoomResult error

func (*RongCloud) ChatRoomKeepAliveAdd

func (rc *RongCloud) ChatRoomKeepAliveAdd(id string) error

ChatRoomKeepAliveAdd 添加保活聊天室

*@param  id:聊天室 ID。
*@return error

func (*RongCloud) ChatRoomKeepAliveGetList

func (rc *RongCloud) ChatRoomKeepAliveGetList() ([]string, error)

ChatRoomKeepAliveGetList 获取保活聊天室

*@param  id:聊天室 ID。
*@return []string error

func (*RongCloud) ChatRoomKeepAliveRemove

func (rc *RongCloud) ChatRoomKeepAliveRemove(id string) error

ChatRoomKeepAliveRemove 删除保活聊天室

*@param  id:聊天室 ID。
*@return error

func (*RongCloud) ChatRoomMuteMembersAdd

func (rc *RongCloud) ChatRoomMuteMembersAdd(id string, members []string, minute uint, options ...ChatroomOption) error

ChatRoomMuteMembersAdd 添加禁言聊天室成员方法(在 App 中如果不想让某一用户在聊天室中发言时,可将此用户在聊天室中禁言,被禁言用户可以接收查看聊天室中用户聊天信息,但不能发送消息.)

*
*@param  id:聊天室 ID。
*@param  members:禁言列表。
*@param  minute:禁言时长,以分钟为单位,最大值为43200分钟。(必传)
*
*@return error

func (*RongCloud) ChatRoomMuteMembersGetList

func (rc *RongCloud) ChatRoomMuteMembersGetList(id string) ([]ChatRoomUser, error)

ChatRoomMuteMembersGetList 查询被禁言聊天室成员方法

*@param  id:聊天室 ID。(必传)
*
*@return []ChatRoomUser error

func (*RongCloud) ChatRoomMuteMembersRemove

func (rc *RongCloud) ChatRoomMuteMembersRemove(id string, members []string, options ...ChatroomOption) error

ChatRoomMuteMembersRemove 移除禁言聊天室成员方法

*@param  id:聊天室Id。
*@param  members:解除禁言列表
*
*@return error

func (*RongCloud) ChatRoomQuery

func (rc *RongCloud) ChatRoomQuery(chatRoomID []string) ([]ChatRoom, error)

ChatRoomQuery 查询聊天室基础信息 *

  • @param chatRoomID 要查询的聊天室id *
  • @return []ChatRoom 聊天室信息数组
  • @return error 错误信息 *

func (*RongCloud) ChatRoomRecall

func (rc *RongCloud) ChatRoomRecall(userId string, targetId string, messageId string, sentTime int,
	options ...MsgOption) error

*

  • @name: ChatRoomRecall
  • @test:
  • @msg: 消息撤回 - 聊天室
  • @param string userId
  • @param string targetId
  • @param string messageId
  • @param int sentTime
  • @param int isAdmin
  • @param int isDelete
  • @param bool disablePush
  • @return: error

func (*RongCloud) ChatRoomSend

func (rc *RongCloud) ChatRoomSend(senderID string, targetID []string, objectName string, msg rcMsg, isPersisted, isIncludeSender int) error

ChatRoomSend 发送聊天室消息方法。(以一个用户身份向群组发送消息,单条消息最大 128k.每秒钟最多发送 20 条消息,每次最多向 3 个群组发送,如:一次向 3 个群组发送消息,示为 3 条消息。)

*@param senderID:发送人用户 ID 。 *@param targetID:接收聊天室ID, 建议最多不超过 10 个聊天室。 *@param objectName:消息类型 *@param msg:发送消息内容 * *@return error

func (*RongCloud) ChatRoomUserBanWhitelistAdd

func (rc *RongCloud) ChatRoomUserBanWhitelistAdd(chatroomId string, members []string, options ...ChatroomOption) error

加入聊天室全体禁言白名单

func (*RongCloud) ChatRoomUserBanWhitelistQuery

func (rc *RongCloud) ChatRoomUserBanWhitelistQuery(chatroomId string) ([]string, error)

查询聊天室全体禁言白名单

func (*RongCloud) ChatRoomUserBanWhitelistRollback

func (rc *RongCloud) ChatRoomUserBanWhitelistRollback(chatroomId string, members []string, options ...ChatroomOption) error

移出聊天室全体禁言白名单

func (*RongCloud) ChatRoomUserWhitelistAdd

func (rc *RongCloud) ChatRoomUserWhitelistAdd(id string, members []string) error

ChatRoomUserWhitelistAdd 添加聊天室白名单成员方法

*@param  id:聊天室 ID。
*@param  members:白名单列表,最多不超过 5 个。
*@return error

func (*RongCloud) ChatRoomUserWhitelistGetList

func (rc *RongCloud) ChatRoomUserWhitelistGetList(id string) ([]string, error)

ChatRoomUserWhitelistGetList 获取聊天室用户白名单

*@param  id:聊天室 ID。
*@return []string error

func (*RongCloud) ChatRoomUserWhitelistRemove

func (rc *RongCloud) ChatRoomUserWhitelistRemove(id string, members []string) error

ChatRoomUserWhitelistRemove 将用户从白名单中移除

*@param  id:聊天室 ID。
*@param  members:白名单列表,最多不超过 5 个。
*@return error

func (*RongCloud) ChatRoomWhitelistAdd

func (rc *RongCloud) ChatRoomWhitelistAdd(objectNames []string) error

ChatRoomWhitelistAdd 添加聊天室消息白名单

*@param  objectNames:消息类型列表。
*@return error

func (*RongCloud) ChatRoomWhitelistGetList

func (rc *RongCloud) ChatRoomWhitelistGetList() ([]string, error)

ChatRoomWhitelistGetList 获取聊天室消息白名单

*@return []string error

func (*RongCloud) ChatRoomWhitelistRemove

func (rc *RongCloud) ChatRoomWhitelistRemove(objectNames []string) error

ChatRoomWhitelistRemove 删除聊天室消息白名单

*@param  objectNames:消息类型列表。
*@return error

func (*RongCloud) ChatUserExist

func (rc *RongCloud) ChatUserExist(chatroomId, userId string) ([]byte, error)

ChatUserExist :/chatroom/user/exist.json 查询用户是否加入聊天室 *

@param: chatroomId,要查询的聊天室 ID
@param: userId, 要查询的用户 ID
response: byte数组

*//

func (*RongCloud) ChatUserExistResObj

func (rc *RongCloud) ChatUserExistResObj(chatroomId, userId string) (ChatUserExistObj, error)

ChatUserExistResObj :/chatroom/user/exist.json 查询用户是否加入聊天室 *

@param: chatroomId,要查询的聊天室 ID
@param: userId, 要查询的用户 ID
response: ChatUserExistObj

*//

func (*RongCloud) ConversationGet

func (rc *RongCloud) ConversationGet(conversationType ConversationType, userID, targetID string,
	options ...MsgOption) (int, error)

ConversationGet 免打扰会话状态获取

*@param conversationType:会话类型 PRIVATE、GROUP、DISCUSSION、SYSTEM。 *@param userID:设置用户 ID。 *@param targetID:需要屏蔽的目标 ID。 * *@return int error

func (*RongCloud) ConversationMute

func (rc *RongCloud) ConversationMute(conversationType ConversationType, userID, targetID string,
	options ...MsgOption) error

ConversationMute 设置用户某个会话屏蔽 Push

*@param conversationType:会话类型 PRIVATE、GROUP、DISCUSSION、SYSTEM。 *@param userID:设置用户 ID。 *@param targetID:需要屏蔽的目标 ID。 * *@return error

func (*RongCloud) ConversationNotificationGet

func (rc *RongCloud) ConversationNotificationGet(ct ConversationType, requestId, targetId, busChannel string) (int, error)

ConversationNotificationGet 查询指定会话消息免打扰接口

func (*RongCloud) ConversationNotificationSet

func (rc *RongCloud) ConversationNotificationSet(ct ConversationType, requestId, targetId, busChannel string, isMuted, unPushLevel int) error

ConversationNotificationSet 设置指定会话消息免打扰接口, 设置用户指定会话消息提醒状态

func (*RongCloud) ConversationTop

func (rc *RongCloud) ConversationTop(conversationType ConversationType, userId, targetId, setTop string) error

ConversationTop :会话置顶 * @param userId :必传 用户ID,会话所属的用户 @param conversationType:不必传 会话类型。支持的会话类型包括:1(二人会话)、3(群组会话)、6(系统会话)。 @param targetId: 必传 需要设置的目标 ID,根据会话类型不同为单聊用户 ID、群聊 ID、系统目标 ID @param setTop : 必传 true 表示置顶,false 表示取消置顶。

@return error */

func (*RongCloud) ConversationTypeNotificationGet

func (rc *RongCloud) ConversationTypeNotificationGet(ct ConversationType, requestId string) (int, error)

ConversationTypeNotificationGet 查询用户指定会话类型(单聊、群聊、超级群、系统消息)的免打扰状态。

func (*RongCloud) ConversationTypeNotificationSet

func (rc *RongCloud) ConversationTypeNotificationSet(ct ConversationType, requestId string, unPushLevel int) error

ConversationTypeNotificationSet 按会话类型设置免打扰, 用户设置指定会话类型(单聊、群聊、超级群、系统消息)的免打扰状态。

func (*RongCloud) ConversationUnmute

func (rc *RongCloud) ConversationUnmute(conversationType ConversationType, userID, targetID string,
	options ...MsgOption) error

ConversationUnmute 设置用户某个会话接收 Push

*@param conversationType:会话类型 PRIVATE、GROUP、DISCUSSION、SYSTEM。 *@param userID:设置用户 ID。 *@param targetID:需要屏蔽的目标 ID。 * *@return error

func (*RongCloud) DeleteMessageExpansion

func (rc *RongCloud) DeleteMessageExpansion(msgUID, userId, conversationType, targetId string, isSyncSender int, keys ...string) error

DeleteMessageExpansion 删除消息扩展

func (*RongCloud) GetHttpTransport

func (rc *RongCloud) GetHttpTransport() http.RoundTripper

func (*RongCloud) GroupCreate

func (rc *RongCloud) GroupCreate(id, name string, members []string) error

GroupCreate 创建群组方法(创建群组,并将用户加入该群组,用户将可以收到该群的消息,同一用户最多可加入 500 个群,每个群最大至 3000 人,App 内的群组数量没有限制.注:其实本方法是加入群组方法 /group/join 的别名。)

*@param  id:群组 Id,最大长度 30 个字符,建议使用 英文字母、数字 混排
*@param  name:群组名称,最大长度 60 个字符
*@param  members:加入群组的用户列表
*
*@return error

func (*RongCloud) GroupDismiss

func (rc *RongCloud) GroupDismiss(id, member string) error

GroupDismiss 解散群组方法

*@param  id:群组 ID,最大长度 30 个字符,建议使用 英文字母、数字 混排
*@param  member:群主或群管理.
*
*@return error

func (*RongCloud) GroupGagAdd

func (rc *RongCloud) GroupGagAdd(id string, members []string, minute int) error

GroupGagAdd 添加禁言群成员方法(在 App 中如果不想让某一用户在群中发言时,可将此用户在群组中禁言,被禁言用户可以接收查看群组中用户聊天信息,但不能发送消息。)

*@param id:群组 ID。 *@param members:禁言群成员列表。 *@param minute:禁言时长,以分钟为单位,最大值为43200分钟。 * *@return error

func (*RongCloud) GroupGagList

func (rc *RongCloud) GroupGagList(id string) (Group, error)

GroupGagList 查询被禁言群成员方法

*@param id:群组ID。 * *@return Group error

func (*RongCloud) GroupGagRemove

func (rc *RongCloud) GroupGagRemove(id string, members []string) error

GroupGagRemove 移除禁言群成员方法

*@param id:群组 Id。 *@param members:解除禁言群成员列表 。 * *@return error

func (*RongCloud) GroupGet

func (rc *RongCloud) GroupGet(id string) (Group, error)

GroupGet 查询群成员方法

*@param  id:群组Id。
*
*@return Group error

func (*RongCloud) GroupJoin

func (rc *RongCloud) GroupJoin(groupId, groupName string, memberId ...string) error

GroupJoin 批量将用户加入指定群组,用户将可以收到该群的消息。

*@param  groupId:加入的群组 Id。
*@param  groupName:群组名称,最大长度 60 个字符。
*@param  memberId:要加入群组的用户,最大不超过1000人。
*
*@return error

func (*RongCloud) GroupMuteAllMembersAdd

func (rc *RongCloud) GroupMuteAllMembersAdd(members []string) error

GroupMuteAllMembersAdd 设置某一群组禁言,禁言后群组中所有成员禁止发送消息,如需要某些用户可以发言时,可将此用户加入到群禁言用户白名单中。

*@param members:禁言群成员列表。 * *@return error

func (*RongCloud) GroupMuteAllMembersGetList

func (rc *RongCloud) GroupMuteAllMembersGetList(members []string) (GroupInfo, error)

GroupMuteAllMembersGetList 查询全部群组禁言列表

*@param id:群组ID。 * *@return Group error

func (*RongCloud) GroupMuteAllMembersRemove

func (rc *RongCloud) GroupMuteAllMembersRemove(members []string) error

GroupMuteAllMembersRemove 解除群组禁言

*@param members:禁言群成员列表。 * *@return error

func (*RongCloud) GroupMuteMembersAdd

func (rc *RongCloud) GroupMuteMembersAdd(id string, members []string, minute int) error

GroupMuteMembersAdd 添加禁言群成员方法(在 App 中如果不想让某一用户在群中发言时,可将此用户在群组中禁言,被禁言用户可以接收查看群组中用户聊天信息,但不能发送消息。)

*@param id:群组 ID。 *@param members:禁言群成员列表。 *@param minute:禁言时长,以分钟为单位,最大值为43200分钟。 * *@return error

func (*RongCloud) GroupMuteMembersGetList

func (rc *RongCloud) GroupMuteMembersGetList(id string) (Group, error)

GroupMuteMembersGetList 查询被禁言群成员方法

*@param id:群组ID。 * *@return Group error

func (*RongCloud) GroupMuteMembersRemove

func (rc *RongCloud) GroupMuteMembersRemove(id string, members []string) error

GroupMuteMembersRemove 移除禁言群成员方法

*@param id:群组 Id。 *@param members:解除禁言群成员列表 。 * *@return error

func (*RongCloud) GroupMuteWhiteListUserAdd

func (rc *RongCloud) GroupMuteWhiteListUserAdd(id string, members []string) error

GroupMuteWhiteListUserAdd 在群组被禁言状态下,如果需要某些用户可以发言时,可将此用户加入到群组禁言用户白名单中。群禁言用户白名单,只有群组被设置为全部禁言时才会生效。

*@param id:群组 ID。 *@param members:禁言群成员列表。 * *@return error

func (*RongCloud) GroupMuteWhiteListUserGetList

func (rc *RongCloud) GroupMuteWhiteListUserGetList(id string) ([]string, error)

GroupMuteWhiteListUserGetList 查询群禁言白名单用户列表。

*@param id:群组 ID。 * *@return error

func (*RongCloud) GroupMuteWhiteListUserRemove

func (rc *RongCloud) GroupMuteWhiteListUserRemove(id string, members []string) error

GroupMuteWhiteListUserRemove 移除群禁言白名单用户。

*@param id:群组 ID。 *@param members:禁言群成员列表。 * *@return error

func (*RongCloud) GroupQuit

func (rc *RongCloud) GroupQuit(member []string, id string) error

GroupQuit 批量退出群组方法(将用户从群中移除,不再接收该群组的消息.)

*@param  id:要退出的群组 Id。
*@param  member:要退出群组的群成员,最多不能超过1000人。
*
*@return error

func (*RongCloud) GroupRecall

func (rc *RongCloud) GroupRecall(senderID, targetID, uID string, sentTime int,
	options ...MsgOption) error

GroupRecall 撤回群聊消息

*@param senderID:发送人用户 ID。 *@param targetID:接收用户 ID。 *@param uID:消息的唯一标识,各端 SDK 发送消息成功后会返回 uID。 *@param sentTime:消息的发送时间,各端 SDK 发送消息成功后会返回 sentTime。 * @param int isAdmin * @param int isDelete * @param bool disablePush *@return error

func (*RongCloud) GroupRemarksDel

func (rc *RongCloud) GroupRemarksDel(userId string, groupId string) error

GroupRemarksDel :/group/remarks/del.json 删除群成员推送备注名 * @param : userId : 群成员用户 ID @param : groupId : 群ID

*/

func (*RongCloud) GroupRemarksGet

func (rc *RongCloud) GroupRemarksGet(userId string, groupId string) ([]byte, error)

GroupRemarksGet :/group/remarks/get.json 查询群成员推送备注名 * @param : userId : 群成员用户 ID @param : groupId : 群ID response : byte数组 文档: https://doc.rongcloud.cn/imserver/server/v1/group/get-remark-for-group-push */

func (*RongCloud) GroupRemarksGetResObj

func (rc *RongCloud) GroupRemarksGetResObj(userId string, groupId string) (GroupRemarksGetObj, error)

GroupRemarksGetResObj :/group/remarks/get.json 查询群成员推送备注名 * @param : userId : 群成员用户 ID @param : groupId : 群ID response : byte数组 文档: https://doc.rongcloud.cn/imserver/server/v1/group/get-remark-for-group-push */

func (*RongCloud) GroupRemarksSet

func (rc *RongCloud) GroupRemarksSet(userId string, groupId string, remark string) error

GroupRemarksSet :/group/remarks/set.json 设置指定群成员推送备注 * @param : userId : 群成员用户ID @param : groupId : 群ID @param : remark : 群成员推送备注

*/

func (*RongCloud) GroupSend

func (rc *RongCloud) GroupSend(senderID string, targetID, userID []string, objectName string, msg rcMsg,
	pushContent string, pushData string, isPersisted, isIncludeSender int, options ...MsgOption) error

GroupSend 发送群组消息方法(以一个用户身份向群组发送消息,单条消息最大 128k.每秒钟最多发送 20 条消息,每次最多向 3 个群组发送,如:一次向 3 个群组发送消息,示为 3 条消息。)

*@param  senderID:发送人用户 ID 。
*@param  targetID:接收群ID.
*@param  objectName:消息类型。
*@param  userID:群定向消群定向消息功能,向群中指定的一个或多个用户发送消息,群中其他用户无法收到该消息,当 targetID 为一个群组时此参数有效。注:如果开通了“单群聊消息云存储”功能,群定向消息不会存储到云端,向群中部分用户发送消息阅读状态回执时可使用此功能。(可选)
*@param  msg:发送消息内容
*@param  pushContent:定义显示的 Push 内容,如果 objectName 为融云内置消息类型时,则发送后用户一定会收到 Push 信息. 如果为自定义消息,则 pushContent 为自定义消息显示的 Push 内容,如果不传则用户不会收到 Push 通知。
*@param  pushData:针对 iOS 平台为 Push 通知时附加到 payload 中,Android 客户端收到推送消息时对应字段名为 pushData。
*@param  isPersisted:当前版本有新的自定义消息,而老版本没有该自定义消息时,老版本客户端收到消息后是否进行存储,0 表示为不存储、 1 表示为存储,默认为 1 存储消息。
*@param  isIncludeSender:发送用户自已是否接收消息,0 表示为不接收,1 表示为接收,默认为 0 不接收。
*@param  options 发送消息需要用的其他扩展参数
*
*@return error

func (*RongCloud) GroupSendMention

func (rc *RongCloud) GroupSendMention(senderID string, targetID []string, objectName string, msg MentionMsgContent,
	pushContent, pushData string, isPersisted, isIncludeSender, isMentioned, contentAvailable int, options ...MsgOption) error

GroupSendMention 发送群组 @ 消息

*@param senderID:发送人用户 ID 。 *@param targetID:接收群ID,最多不超过 3 个群组。 *@param objectName:消息类型。 *@param msg:发送消息内容。 *@param pushContent:定义显示的 Push 内容,如果 objectName 为融云内置消息类型时,则发送后用户一定会收到 Push 信息. 如果为自定义消息,则 pushContent 为自定义消息显示的 Push 内容,如果不传则用户不会收到 Push 通知。 *@param pushData:针对 iOS 平台为 Push 通知时附加到 payload 中,Android 客户端收到推送消息时对应字段名为 pushData。 *@param isPersisted:当前版本有新的自定义消息,而老版本没有该自定义消息时,老版本客户端收到消息后是否进行存储,0 表示为不存储、 1 表示为存储,默认为 1 存储消息。 *@param isIncludeSender:发送用户自已是否接收消息,0 表示为不接收,1 表示为接收,默认为 0 不接收。 *@param isMentioned:是否为 @消息,0 表示为普通消息,1 表示为 @消息,默认为 0。当为 1 时 content 参数中必须携带 mentionedInfo @消息的详细内容。为 0 时则不需要携带 mentionedInfo。当指定了 toUserId 时,则 @ 的用户必须为 toUserId 中的用户。 *@param contentAvailable:针对 iOS 平台,对 SDK 处于后台暂停状态时为静默推送,是 iOS7 之后推出的一种推送方式。 允许应用在收到通知后在后台运行一段代码,且能够马上执行,查看详细。1 表示为开启,0 表示为关闭,默认为 0 * *@return error

func (*RongCloud) GroupStatusSend

func (rc *RongCloud) GroupStatusSend(senderID string, toGroupIds []string, objectName string, msg rcMsg,
	verifyBlacklist int, isIncludeSender int, options ...MsgOption) error

群聊状态消息发送 senderID: 发送人用户 ID。 toGroupIds: 接收群ID,提供多个本参数可以实现向多群发送消息,最多不超过 3 个群组。 objectName: 消息类型 msg: 所发送消息的内容 verifyBlacklist: 是否过滤发送人黑名单列表,0 表示为不过滤、 1 表示为过滤,默认为 0 不过滤。 isIncludeSender: 发送用户自己是否接收消息,0 表示为不接收,1 表示为接收,默认为 0 不接收。

func (*RongCloud) GroupSync

func (rc *RongCloud) GroupSync(id string, groups []Group) error

GroupSync 同步用户所属群组方法(当第一次连接融云服务器时,需要向融云服务器提交 ID 对应的用户当前所加入的所有群组,此接口主要为防止应用中用户群信息同融云已知的用户所属群信息不同步。)

*@param  id:被同步群信息的用户 ID。(必传)
*@param  groups:用户所在群组列表。
*
*@return error

func (*RongCloud) GroupUpdate

func (rc *RongCloud) GroupUpdate(id, name string) error

GroupUpdate 刷新群组信息方法

*@param id:群组 Id。 *@param name:群名称。 * *@return error

func (*RongCloud) GroupUserGagAdd

func (rc *RongCloud) GroupUserGagAdd(userId string, groupId string, minute string) error

GroupUserGagAdd : 添加禁言成员 /group/user/gag/add.json * @param userId:用户 ID,每次添加最多不超过 20 个用户。 @param groupId: 群组 ID,为空时则设置用户在加入的所有群组中都不能发送消息。 @param minute : // 禁言时长,以分钟为单位,最大值为 43200 分钟,为 0 表示永久禁言。 */

func (*RongCloud) GroupUserQuery

func (rc *RongCloud) GroupUserQuery(userId string) ([]byte, error)

GroupUserQuery : 根据用户 ID 查询该用户加入的所有群组,返回群组 ID 及群组名称。 * @param userId:用户 ID 文档 : https://doc.rongcloud.cn/imserver/server/v1/group/query-group-by-user */

func (*RongCloud) GroupUserQueryResObj

func (rc *RongCloud) GroupUserQueryResObj(userId string) (GroupUserQueryObj, error)

GroupUserQueryResObj : 根据用户 ID 查询该用户加入的所有群组,返回群组 ID 及群组名称。 * @param userId:用户 ID response: GroupUserQueryObj 文档: https://doc.rongcloud.cn/imserver/server/v1/group/query-group-by-user */

func (*RongCloud) HistoryGet

func (rc *RongCloud) HistoryGet(date string) (History, error)

HistoryGet 按小时获取历史消息日志文件 URL,包含小时内应用产生的所有消息,消息日志文件无论是否已下载,3 天后将从融云服务器删除

*@param date:精确到小时,例如: 2018030210 表示获取 2018 年 3 月 2 日 10 点至 11 点产生的数据 * *@return History error

func (*RongCloud) HistoryRemove

func (rc *RongCloud) HistoryRemove(date string) error

HistoryRemove 删除历史消息日志文件

*@param date:精确到小时,例如: 2018030210 表示获取 2018 年 3 月 2 日 10 点至 11 点产生的数据 * *@return error

func (*RongCloud) MessageBroadcastRecall

func (rc *RongCloud) MessageBroadcastRecall(userId string, objectName string, content BroadcastRecallContent) error

*

  • @name: MessageBroadcastRecall
  • @test:
  • @msg:广播消息撤回
  • @param string userId
  • @param string objectName
  • @param BroadcastRecallContent content
  • @return: error

func (*RongCloud) MessageExpansionDel

func (rc *RongCloud) MessageExpansionDel(msgUID, userId, conversationType, targetId, extraKey string, isSyncSender int) error

MessageExpansionDel : 删除消息扩展 /message/expansion/delete.json * @param msgUID:消息唯一标识 ID,可通过全量消息路由功能获取。详见全量消息路由。 @param userId:操作者用户 ID,即需要为指定消息(msgUID)删除扩展信息的用户 ID。 @param conversationType:会话类型。支持的会话类型包括:1(二人会话)、3(群组会话)。 @param targetId:目标 ID,根据不同的 conversationType,可能是用户 ID 或群组 ID。 @param extraKeyVal:消息自定义扩展内容,JSON 结构,以 Key、Value 的方式进行设置,如:{"type":"3"},单条消息可设置 300 个扩展信息,一次最多可以设置 100 个。 @param isSyncSender:设置操作会生成“扩展操作消息”。该字段指定“扩展操作消息”的发送者是否可在客户端接收该消息。具体请看。https://doc.rongcloud.cn/imserver/server/v1/message/expansion#delete */

func (*RongCloud) MessageExpansionSet

func (rc *RongCloud) MessageExpansionSet(msgUID, userId, conversationType, targetId, extraKeyVal string, isSyncSender int) error

MessageExpansionSet : 设置消息扩展 /message/expansion/set.json * @param msgUID:消息唯一标识 ID,可通过全量消息路由功能获取。详见全量消息路由。 @param userId:操作者用户 ID,即需要为指定消息(msgUID)设置扩展信息的用户 ID。 @param conversationType:会话类型。支持的会话类型包括:1(二人会话)、3(群组会话)。 @param targetId:目标 ID,根据不同的 conversationType,可能是用户 ID 或群组 ID。 @param extraKeyVal:消息自定义扩展内容,JSON 结构,以 Key、Value 的方式进行设置,如:{"type":"3"},单条消息可设置 300 个扩展信息,一次最多可以设置 100 个。 @param isSyncSender:设置操作会生成“扩展操作消息”。该字段指定“扩展操作消息”的发送者是否可在客户端接收该消息。https://doc.rongcloud.cn/imserver/server/v1/message/expansion#set */

func (*RongCloud) OnlineBroadcast

func (rc *RongCloud) OnlineBroadcast(fromUserId string, objectName string, content string) ([]byte, error)

在线广播消息 是指系统向 App 中所有在线用户发送消息的行为。当用户正在使用 App 时,消息会展示在聊天界面和会话列表界面,会话类型为 SYSTEM。 @param fromUserId 发送人用户 Id @param objectName 消息类型, @param content 发送消息内容

func (*RongCloud) OnlineStatusCheck

func (rc *RongCloud) OnlineStatusCheck(userID string) (int, error)

OnlineStatusCheck 检查用户在线状态

*@param userID:用户 ID,最大长度 64 字节.是用户在 App 中的唯一标识码,必须保证在同一个 App 内不重复,重复的用户 Id 将被当作是同一用户。 * *@return int, error

func (*RongCloud) PrivateRecall

func (rc *RongCloud) PrivateRecall(senderID, targetID, uID string, sentTime int,
	options ...MsgOption) error

PrivateRecall 撤回单聊消息方法

* *@param senderID:发送人用户 ID。 *@param targetID:接收用户 ID。 *@param uID:消息的唯一标识,各端 SDK 发送消息成功后会返回 uID。 *@param sentTime:消息的发送时间,各端 SDK 发送消息成功后会返回 sentTime。 * @param int isAdmin * @param int isDelete * @param bool disablePush *@return error

func (*RongCloud) PrivateSend

func (rc *RongCloud) PrivateSend(senderID string, targetID []string, objectName string, msg rcMsg,
	pushContent, pushData string, count, verifyBlacklist, isPersisted, isIncludeSender, contentAvailable int,
	options ...MsgOption) error

PrivateSend 发送单聊消息方法(一个用户向多个用户发送消息,单条消息最大 128k。每分钟最多发送 6000 条信息,每次发送用户上限为 1000 人,如:一次发送 1000 人时,示为 1000 条消息。)

*@param  senderID:发送人用户 ID。
*@param  targetID:接收用户 ID。可以实现向多人发送消息,每次上限为 1000 人。
*@param  objectName:发送的消息类型。
*@param  msg:消息内容。
*@param  pushContent:定义显示的 Push 内容,如果 objectName 为融云内置消息类型时,则发送后用户一定会收到 Push 信息。如果为自定义消息,则 pushContent 为自定义消息显示的 Push 内容,如果不传则用户不会收到 Push 通知。
*@param  pushData:针对 iOS 平台为 Push 通知时附加到 payload 中,Android 客户端收到推送消息时对应字段名为 pushData。
*@param  count:针对 iOS 平台,Push 时用来控制未读消息显示数,只有在 toUserId 为一个用户 Id 的时候有效。
*@param  verifyBlacklist:是否过滤发送人黑名单列表,0 表示为不过滤、 1 表示为过滤,默认为 0 不过滤。
*@param  isPersisted:当前版本有新的自定义消息,而老版本没有该自定义消息时,老版本客户端收到消息后是否进行存储,0 表示为不存储、 1 表示为存储,默认为 1 存储消息。
*@param  isIncludeSender:发送用户自已是否接收消息,0 表示为不接收,1 表示为接收,默认为 0 不接收。
*@param  contentAvailable:针对 iOS 平台,对 SDK 处于后台暂停状态时为静默推送,是 iOS7 之后推出的一种推送方式。 允许应用在收到通知后在后台运行一段代码,且能够马上执行,查看详细。1 表示为开启,0 表示为关闭,默认为 0。
*@param  options 发送消息需要用的其他扩展参数
*
*@return error

func (*RongCloud) PrivateSendTemplate

func (rc *RongCloud) PrivateSendTemplate(senderID, objectName string, template TXTMsg, content []TemplateMsgContent,
	options ...MsgOption) error

PrivateSendTemplate 向多个用户发送不同内容消息

*@param  senderID:发送人用户 ID。
*@param  objectName:发送的消息类型。
*@param  template:消息模版。
*@param  content:数据内容,包含消息内容和接收者。
*@param  options 发送消息需要用的其他扩展参数
*
*@return error

func (*RongCloud) PrivateStatusSend

func (rc *RongCloud) PrivateStatusSend(senderID string, targetID []string, objectName string, msg rcMsg,
	verifyBlacklist int, isIncludeSender int, options ...MsgOption) error

私聊状态消息发送 senderID: 发送人用户 ID。 targetID: 接收用户 ID,支持向多人发送消息,每次上限为 1000 人。 objectName: 消息类型 msg: 所发送消息的内容 verifyBlacklist: 是否过滤发送人黑名单列表,0 表示为不过滤、 1 表示为过滤,默认为 0 不过滤。 isIncludeSender: 发送用户自己是否接收消息,0 表示为不接收,1 表示为接收,默认为 0 不接收。

func (*RongCloud) PrivateURI

func (rc *RongCloud) PrivateURI(uri, sms string)

PrivateURI 私有云设置 Api 地址

func (*RongCloud) PushCustom

func (rc *RongCloud) PushCustom(p []byte) ([]byte, error)

PushCustom : 全量用户不落地通知 /push/custom.json *

@param: p:参考这个TestRongCloud_PushCustom 单元测试传递的参数
@param: platform []string 目标操作系统,iOS、Android 最少传递一个。如果需要给两个系统推送消息时,则需要全部填写。
@param: audience  string 推送条件,包括:tag 、tag_or 、packageName 、 is_to_all。
@param: notification string 按操作系统类型推送消息内容,如 platform 中设置了给 iOS 和 Android 系统推送消息,而在 notification 中只设置了 iOS 的推送内容,则 Android 的推送内容为最初 alert 设置的内容,详细查看 notification 结构说明。

请求按照PushCustomData结构体请求: 可以构建为上面的map或者struct 进行json序列化之后调用PushCustom response: 返回byte数组 文档 : https://doc.rongcloud.cn/imserver/server/v1/push-plus#push_custom *//

func (*RongCloud) PushCustomObj

func (rc *RongCloud) PushCustomObj(data PushCustomData) (PushCustomObj, error)

PushCustomObj : 全量用户不落地通知 /push/custom.json *

@param: p:参考这个TestRongCloud_PushCustom 单元测试传递的参数
@param: platform []string 目标操作系统,iOS、Android 最少传递一个。如果需要给两个系统推送消息时,则需要全部填写。
@param: audience  string 推送条件,包括:tag 、tag_or 、packageName 、 is_to_all。
@param: notification string 按操作系统类型推送消息内容,如 platform 中设置了给 iOS 和 Android 系统推送消息,而在 notification 中只设置了 iOS 的推送内容,则 Android 的推送内容为最初 alert 设置的内容,详细查看 notification 结构说明。

可以构建为上面的map或者struct 进行json序列化之后调用PushCustom response: 返回结构体 文档: https://doc.rongcloud.cn/imserver/server/v1/push-plus#push_custom *//

func (*RongCloud) PushCustomResObj

func (rc *RongCloud) PushCustomResObj(p []byte) (PushCustomObj, error)

PushCustomResObj : 全量用户不落地通知 /push/custom.json *

@param: p:参考这个TestRongCloud_PushCustom 单元测试传递的参数
@param: platform []string 目标操作系统,iOS、Android 最少传递一个。如果需要给两个系统推送消息时,则需要全部填写。
@param: audience  string 推送条件,包括:tag 、tag_or 、packageName 、 is_to_all。
@param: notification string 按操作系统类型推送消息内容,如 platform 中设置了给 iOS 和 Android 系统推送消息,而在 notification 中只设置了 iOS 的推送内容,则 Android 的推送内容为最初 alert 设置的内容,详细查看 notification 结构说明。

可以构建为上面的map或者struct 进行json序列化之后调用PushCustom 请求按照PushCustomData结构体请求: response: 返回结构体 文档: https://doc.rongcloud.cn/imserver/server/v1/push-plus#push_custom *//

func (*RongCloud) PushSend

func (rc *RongCloud) PushSend(sender Sender) (PushResult, error)

PushSend 此方法与 /message/broadcast 广播消息方法发送机制一样,可选择更多发送条件。 该功能开发环境下可免费使用。生产环境下,您需要在开发者后台高级功能设置中开通 IM 商用版后,在“广播消息和推送”中,开启后才能使用。 推送和广播消息合计每小时只能发送 2 次,每天最多发送 3 次。如需要调整发送频率.

*@param Push: 广播消息体 push。 * *@return PushResult, error

func (*RongCloud) PushUser

func (rc *RongCloud) PushUser(notification *PushNotification, users ...string) error

PushUser 向应用中指定用户发送不落地通知,不落地通知无论用户是否正在使用 App,都会向该用户发送通知,通知只会展示在通知栏,通知中不携带消息内容,登录 App 后不会在聊天页面看到该内容,不会存储到本地数据库。

func (*RongCloud) QueryMessageExpansion

func (rc *RongCloud) QueryMessageExpansion(msgUID string, page int) ([]MessageExpansionItem, error)

QueryMessageExpansion 获取扩展信息 根据消息 ID 获取指定消息扩展信息

func (*RongCloud) QueryWhiteList

func (rc *RongCloud) QueryWhiteList(userId string) (WhiteList, error)

*

  • @name: QueryWhiteList
  • @test:
  • @msg: 获取某用户白名单列表(每秒限100次)
  • @param string userId
  • @return: WhiteList error

func (*RongCloud) RemoveWhiteList

func (rc *RongCloud) RemoveWhiteList(userId string, whiteList []string) error

*

  • @name: RemoveWhiteList
  • @test:
  • @msg: 移除白名单中用户(每秒限 100 次)
  • @param string userId
  • @param []string whiteList
  • @return: error

func (*RongCloud) SensitiveAdd

func (rc *RongCloud) SensitiveAdd(keyword, replace string, sensitiveType int) error

SensitiveAdd 添加敏感词

*@param keyword:敏感词,最长不超过 32 个字符,格式为汉字、数字、字母 *@param replace:敏感词替换,最长不超过 32 个字符, 敏感词屏蔽可以为空 *@param sensitiveType:0: 敏感词替换 1: 敏感词屏蔽 * *@return error

func (*RongCloud) SensitiveGetList

func (rc *RongCloud) SensitiveGetList() (ListWordFilterResult, error)

SensitiveGetList 查询敏感词列表方法

*@return ListWordFilterResult error

func (*RongCloud) SensitiveRemove

func (rc *RongCloud) SensitiveRemove(keywords []string) error

SensitiveRemove 移除敏感词方法(从敏感词列表中,移除某一敏感词。)

*@param keywords:每次最多删除 50 个敏感词,2 小时后生效 * *@return error

func (*RongCloud) SetHttpTransport

func (rc *RongCloud) SetHttpTransport(httpTransport http.RoundTripper)

自定义 http 参数

func (*RongCloud) SetMessageExpansion

func (rc *RongCloud) SetMessageExpansion(msgUID, userId, conversationType, targetId string, extra map[string]string, isSyncSender int) error

SetMessageExpansion 设置消息扩展 发送消息时,如设置了 expansion 为 true,可对该条消息进行扩展信息设置,每次最多可以设置 100 个扩展属性信息,最多可设置 300 个。

func (*RongCloud) SystemBroadcast

func (rc *RongCloud) SystemBroadcast(senderID, objectName string, msg rcMsg, options ...MsgOption) error

SystemBroadcast 给应用内所有用户发送消息方法,每小时最多发 2 次,每天最多发送 3 次(以一个用户身份向群组发送消息,单条消息最大 128k.每秒钟最多发送 20 条消息。)

*@param senderID:发送人用户 ID 。 *@param objectName:消息类型 *@param msg:发送消息内容 * *@return error

func (*RongCloud) SystemRecall

func (rc *RongCloud) SystemRecall(userId string, targetId string, messageId string, sentTime int,
	options ...MsgOption) error

*

  • @name: SystemRecall
  • @test:
  • @msg: 消息撤回 - 系统会话
  • @param string userId
  • @param string targetId
  • @param string messageId
  • @param int sentTime
  • @param int isAdmin
  • @param int isDelete
  • @param bool disablePush
  • @return: error

func (*RongCloud) SystemSend

func (rc *RongCloud) SystemSend(senderID string, targetID []string, objectName string, msg rcMsg,
	pushContent, pushData string, count, isPersisted int, options ...MsgOption) error

SystemSend 一个用户向一个或多个用户发送系统消息,单条消息最大 128k,会话类型为 SYSTEM。

*@param senderID:发送人用户 ID。 *@param targetID:接收用户 ID, 上限为 100 人。 *@param objectName:发送的消息类型。 *@param msg:消息。 *@param pushContent:定义显示的 Push 内容,如果 objectName 为融云内置消息类型时,则发送后用户一定会收到 Push 信息。如果为自定义消息,则 pushContent 为自定义消息显示的 Push 内容,如果不传则用户不会收到 Push 通知。 *@param pushData:针对 iOS 平台为 Push 通知时附加到 payload 中,Android 客户端收到推送消息时对应字段名为 pushData。 *@param count:针对 iOS 平台,Push 时用来控制未读消息显示数,只有在 toUserId 为一个用户 Id 的时候有效。 *@param isPersisted:当前版本有新的自定义消息,而老版本没有该自定义消息时,老版本客户端收到消息后是否进行存储,0 表示为不存储、 1 表示为存储,默认为 1 存储消息。 *@param options 发送消息需要用的其他扩展参数

* *@return error

func (*RongCloud) SystemSendTemplate

func (rc *RongCloud) SystemSendTemplate(senderID, objectName string, template TXTMsg, content []TemplateMsgContent,
	options ...MsgOption) error

SystemSendTemplate 一个用户向一个或多个用户发送系统消息,单条消息最大 128k,会话类型为 SYSTEM

*@param senderID:发送人用户 ID。 *@param objectName:发送的消息类型。 *@param template:消息模版。 *@param content:数据内容,包含消息内容和接收者。 * *@return error

func (*RongCloud) TagBatchSet

func (rc *RongCloud) TagBatchSet(tagBatch TagBatch) error

TagBatchSet 为应用中的用户批量添加标签,如果某用户已经添加了标签,再次对用户添加标签时将覆盖之前设置的标签内容。

*@param t :标签 TagBatch 构造体。 * *@return error

func (*RongCloud) TagGet

func (rc *RongCloud) TagGet(userIds []string) (TagResult, error)

TagGet 查询用户所有标签功能,支持批量查询每次最多查询 50 个用户。

*@param userIds: 用户 ID。 * *@return error

func (*RongCloud) TagSet

func (rc *RongCloud) TagSet(tag Tag) error

TagSet 为应用中的用户添加标签,如果某用户已经添加了标签,再次对用户添加标签时将覆盖之前设置的标签内容。

*@param tag :标签 Tag 构造体。 * *@return error

func (*RongCloud) UGChannelCreate

func (rc *RongCloud) UGChannelCreate(groupId, channelId string) (err error, requestId string)

创建群频道

func (*RongCloud) UGChannelDelete

func (rc *RongCloud) UGChannelDelete(groupId, channelId string) (err error, requestId string)

删除群频道

func (*RongCloud) UGChannelPrivateUserAdd

func (rc *RongCloud) UGChannelPrivateUserAdd(groupId, busChannel, userIds string) ([]byte, error)

UGChannelPrivateUserAdd :私有频道白名单用户-添加 /ultragroup/channel/private/users/add.json

groupId=ug_m_gid_lw_1&busChannel=channel001&userIds=a%2Cb%2Cc

func (*RongCloud) UGChannelPrivateUserAddResObj

func (rc *RongCloud) UGChannelPrivateUserAddResObj(groupId, busChannel, userIds string) (UGChannelPrivateUserAddObj, error)

UGChannelPrivateUserAddResObj :私有频道白名单用户-添加 /ultragroup/channel/private/users/add.json

groupId=ug_m_gid_lw_1&busChannel=channel001&userIds=a%2Cb%2Cc

response :UGChannelPrivateUserAddObj

func (*RongCloud) UGChannelPrivateUserDel

func (rc *RongCloud) UGChannelPrivateUserDel(groupId, busChannel, userIds string) ([]byte, error)

UGChannelPrivateUserDel :私有频道白名单用户-删除 /ultragroup/channel/private/users/del.json

groupId=ug_m_gid_lw_1&busChannel=channel001&userIds=a%2Cb%2Cc
response : byte数组

func (*RongCloud) UGChannelPrivateUserDelResObj

func (rc *RongCloud) UGChannelPrivateUserDelResObj(groupId, busChannel, userIds string) (UGChannelPrivateUserDelObj, error)

UGChannelPrivateUserDelResObj :私有频道白名单用户-删除 /ultragroup/channel/private/users/del.json

groupId=ug_m_gid_lw_1&busChannel=channel001&userIds=a%2Cb%2Cc
response:UGChannelPrivateUserDelObj

func (*RongCloud) UGChannelPrivateUserGet

func (rc *RongCloud) UGChannelPrivateUserGet(groupId, busChannel, page, pageSize string) ([]byte, error)

UGChannelPrivateUserGet :私有频道白名单用户-查询 /ultragroup/channel/private/users/get.json

groupId=ug_m_gid_lw_1&busChannel=channel001&page=1&pageSize=1000
response: byte数组

func (*RongCloud) UGChannelPrivateUserGetResObj

func (rc *RongCloud) UGChannelPrivateUserGetResObj(groupId, busChannel, page, pageSize string) (UGChannelPrivateUserGetObj, error)

UGChannelPrivateUserGetResObj :私有频道白名单用户-查询 /ultragroup/channel/private/users/get.json

groupId=ug_m_gid_lw_1&busChannel=channel001&page=1&pageSize=1000
response: UGChannelPrivateUserGetObj

func (*RongCloud) UGChannelQuery

func (rc *RongCloud) UGChannelQuery(groupId string, page, size int) (channels []UGChannelInfo, err error, requestId string)

查询群频道列表

func (*RongCloud) UGChannelUserGroupBind

func (rc *RongCloud) UGChannelUserGroupBind(groupId, busChannel string, userGroupIds []string) (err error)

UGChannelUserGroupBind 频道批量绑定用户组

func (*RongCloud) UGChannelUserGroupQuery

func (rc *RongCloud) UGChannelUserGroupQuery(groupId, busChannel string, page, pageSize int) (userGroupIds []string, err error)

UGChannelUserGroupQuery 查询频道绑定的用户组列表

func (*RongCloud) UGChannelUserGroupUnbind

func (rc *RongCloud) UGChannelUserGroupUnbind(groupId, busChannel string, userGroupIds []string) (err error)

UGChannelUserGroupUnbind 频道批量解绑用户组

func (*RongCloud) UGGroupChannelChange

func (rc *RongCloud) UGGroupChannelChange(groupId, busChannel, t string) ([]byte, error)

UGGroupChannelChange : /ultragroup/channel/type/change 公私频道类型设置(切换) *

@param: groupId
@param: busChannel
@param: type

*//

func (*RongCloud) UGGroupChannelChangeResObj

func (rc *RongCloud) UGGroupChannelChangeResObj(groupId, busChannel, t string) (UGGroupChannelChangeObj, error)

UGGroupChannelChangeResObj : /ultragroup/channel/type/change 公私频道类型设置(切换) *

@param: groupId
@param: busChannel
@param: type

*//

func (*RongCloud) UGGroupChannelCreate

func (rc *RongCloud) UGGroupChannelCreate(groupId, busChannel, t string) ([]byte, error)

UGGroupChannelCreate : 频道创建-支持设置频道类型/ultragroup/channel/create.json * groupId=ug_m_gid_lw_1&busChannel=channel001&type=0

response:byte数组 *//

func (*RongCloud) UGGroupChannelGet

func (rc *RongCloud) UGGroupChannelGet(groupId string, page, limit int) ([]byte, error)

UGGroupChannelGet :频道查询-返回结果带频道类型 /ultragroup/channel/get.json

groupId=ug_m_gid_lw_1&page=1&limit=20
response:返回byte数组

func (*RongCloud) UGGroupCreate

func (rc *RongCloud) UGGroupCreate(userId, groupId, groupName string) (err error, requestId string)

创建群组

func (*RongCloud) UGGroupDismiss

func (rc *RongCloud) UGGroupDismiss(groupId string) (err error, requestId string)

解散群组

func (*RongCloud) UGGroupJoin

func (rc *RongCloud) UGGroupJoin(userId, groupId string) (err error, requestId string)

加入群组

func (*RongCloud) UGGroupMuteMembersAdd

func (rc *RongCloud) UGGroupMuteMembersAdd(groupId string, userIds []string) (err error, requestId string)

添加禁言成员

func (*RongCloud) UGGroupMuteMembersGetList

func (rc *RongCloud) UGGroupMuteMembersGetList(groupId string) (users []UGUserInfo, err error, requestId string)

获取禁言成员

func (*RongCloud) UGGroupMuteMembersRemove

func (rc *RongCloud) UGGroupMuteMembersRemove(groupId string, userIds []string) (err error, requestId string)

移除禁言成员

func (*RongCloud) UGGroupMuted

func (rc *RongCloud) UGGroupMuted(groupId string, status bool) (err error, requestId string)

设置全体成员禁言

func (*RongCloud) UGGroupMutedQuery

func (rc *RongCloud) UGGroupMutedQuery(groupId string) (status bool, err error, requestId string)

获取群全体成员禁言状态

func (*RongCloud) UGGroupMutedWhitelistAdd

func (rc *RongCloud) UGGroupMutedWhitelistAdd(groupId string, userIds []string) (err error, requestId string)

添加禁言白名单

func (*RongCloud) UGGroupMutedWhitelistQuery

func (rc *RongCloud) UGGroupMutedWhitelistQuery(groupId string) (users []UGUserInfo, err error, requestId string)

获取禁言白名单

func (*RongCloud) UGGroupMutedWhitelistRemove

func (rc *RongCloud) UGGroupMutedWhitelistRemove(groupId string, userIds []string) (err error, requestId string)

移除禁言白名单

func (*RongCloud) UGGroupQuit

func (rc *RongCloud) UGGroupQuit(userId, groupId string) (err error, requestId string)

退出群组

func (*RongCloud) UGGroupSend

func (rc *RongCloud) UGGroupSend(msg UGMessage) (err error, requestId string)

消息发送 普通消息

func (*RongCloud) UGGroupUpdate

func (rc *RongCloud) UGGroupUpdate(groupId, groupName string) (err error, requestId string)

刷新群组信息

func (*RongCloud) UGHisMsgIdQuery

func (rc *RongCloud) UGHisMsgIdQuery(groupId, busChannel, msgUID, prevNum, lastNum string) (UGHisMsgIdQueryResp, error)

UGHisMsgIdQuery API 获取消息ID上下文历史消息 /ultragroup/hismsg/msgid/query.json param: groupId 必填 String 超级群Id param: busChannel 必填 String 频道Id param: msgUID 必填 string 查询指定的消息Id 上下 10 条消息时使用 param: prevNum 不是必填 string 默认 10 条(最大 50 条)即查询消息ID前面的 10 条消息, 当用户传 0 时,不查消息ID前面的数据了 param: lastNum 不是必填 string 默认 10 条(最大 50 条)即查询消息ID 后面的 10 条消息, 当用户传 0 时,不查消息ID后面的数据了

func (*RongCloud) UGHistoryQuery

func (rc *RongCloud) UGHistoryQuery(groupId, busChannel string, startTime, endTime int64, fromUserId string, pageSize int) (UGHisMsgQueryResp, error)

UGHistoryQuery •接口: /ultragroup/hismsg/query.json •作用: 查询超级群历史消息 •限频: appKey 级别的 100 次/分钟 param: groupId 必填 String 超级群Id param: busChannel 必填 String 频道Id param: startTime 必填 int64 查询开始时间戳 param: endTime 必填 int64 查询结束时间戳,开始时间和结束时间最⻓跨度 14 天 param: fromUserId 不是必填 String 消息的发送者 Id , 有该参数只查该用戶发的群消息,否则查群全部历史消息 param: pageSize 不是必填 int 默认 20 条,最大100条 UGHisMsgQueryResp:返回数据结果集 startTime<resultList<=endTime,且resultList数据按消息时间戳升序排列

func (*RongCloud) UGMemberExists

func (rc *RongCloud) UGMemberExists(groupId, userId string) (bool, error)

UGMemberExists 查询用户是否在超级群中

func (*RongCloud) UGMessageExpansionDelete

func (rc *RongCloud) UGMessageExpansionDelete(groupId, userId, msgUID, busChannel string, keys ...string) error

UGMessageExpansionDelete 删除扩展

func (*RongCloud) UGMessageExpansionQuery

func (rc *RongCloud) UGMessageExpansionQuery(groupId, msgUID, busChannel string) ([]UGMessageExpansionItem, error)

UGMessageExpansionQuery 获取扩展信息

func (*RongCloud) UGMessageExpansionSet

func (rc *RongCloud) UGMessageExpansionSet(groupId, userId, msgUID, busChannel string, extra map[string]string) error

UGMessageExpansionSet 设置扩展

func (*RongCloud) UGMessageGet

func (rc *RongCloud) UGMessageGet(groupId string, msgList []UGMessageData, options ...MsgOption) ([]byte, error)

UGMessageGet : 根据消息 ID 批量获取超级群消息 /ultragroup/msg/get * @param groupId:超级群 ID @param msgList:消息参数数组 每个元素是UGMessageData response: 返回byte数组 */

func (*RongCloud) UGMessageGetObj

func (rc *RongCloud) UGMessageGetObj(groupId string, msgList []UGMessageData, options ...MsgOption) (UGMessageGetData, error)

UGMessageGetObj : 根据消息 ID 批量获取超级群消息 /ultragroup/msg/get * @param groupId:超级群 ID @param msgList:消息参数数组 每个元素是UGMessageData response: 返回结构体 */

func (*RongCloud) UGMessageModify

func (rc *RongCloud) UGMessageModify(groupId, fromUserId, msgUID, content string, options ...UgMessageExtension) ([]byte, error)

UGMessageModify : 超级群消息修改 /ultragroup/msg/modify.json * @param groupId:超级群 ID @param fromUserId:消息发送者 @param msgUID:消息唯一标识 @param content:消息所发送内容 最大128k @param busChannel:频道 Id,支持英文字母、数字组合,最长为 20 个字符 @param msgRandom:请求唯一标识,,保证一分钟之内的请求幂等 */

func (*RongCloud) UGMessagePublish

func (rc *RongCloud) UGMessagePublish(fromUserId, objectName, content, pushContent, pushData, isPersisted, isCounted, isMentioned, contentAvailable, busChannel, extraContent string, expansion, unreadCountFlag bool, pushExt *PushExt, toGroupIds ...string) error

UGMessagePublish 超级群消息发送 文档:https://doc.rongcloud.cn/imserver/server/v1/message/msgsend/ultragroup

func (*RongCloud) UGMessageRecall

func (rc *RongCloud) UGMessageRecall(userId, targetId, messageId string, sentTime int, options ...MsgOption) error

UGMessageRecall 超级群消息撤回

func (*RongCloud) UGNotDisturbGet

func (rc *RongCloud) UGNotDisturbGet(groupId, busChannel string) (*UGNotDisturbGetResponses, error)

func (*RongCloud) UGNotDisturbSet

func (rc *RongCloud) UGNotDisturbSet(groupId string, unPushLevel int, busChannel string) error

UGNotDisturbSet 设置群/频道默认免打扰接口

func (*RongCloud) UGQueryGroupUsers

func (rc *RongCloud) UGQueryGroupUsers(groupId string, page, size int) (users []UGUserInfo, err error, requestId string)

查询群成员(P1)

func (*RongCloud) UGQueryUserGroups

func (rc *RongCloud) UGQueryUserGroups(userId string, page, size int) (groups []UGGroupInfo, err error, requestId string)

查询用户所在群组(P1)

func (*RongCloud) UGUserChannelQuery

func (rc *RongCloud) UGUserChannelQuery(groupId, userId string, page, pageSize int) (busChannelIds []string, err error)

UGUserChannelQuery 查询用户所属的频道白名单列表

func (*RongCloud) UGUserGroupAdd

func (rc *RongCloud) UGUserGroupAdd(groupId string, userGroups []UGUserGroupInfo) (err error)

UGUserGroupAdd 批量新建用户组

func (*RongCloud) UGUserGroupChannelQuery

func (rc *RongCloud) UGUserGroupChannelQuery(groupId, userGroupId string, page, pageSize int) (busChannelIds []string, err error)

UGUserGroupChannelQuery 查询用户组绑定的频道列表

func (*RongCloud) UGUserGroupDelete

func (rc *RongCloud) UGUserGroupDelete(groupId string, userGroupIds []string) (err error)

UGUserGroupDelete 批量删除用户组

func (*RongCloud) UGUserGroupQuery

func (rc *RongCloud) UGUserGroupQuery(groupId string, page, pageSize int) (userGroups []UGUserGroupInfo, err error)

UGUserGroupDelete 分页查询超级群下用户组信息

func (*RongCloud) UGUserGroupUserAdd

func (rc *RongCloud) UGUserGroupUserAdd(groupId, userGroupId string, userIds []string) (err error)

UGUserGroupUserAdd 用户组批量增加用户

func (*RongCloud) UGUserGroupUserDelete

func (rc *RongCloud) UGUserGroupUserDelete(groupId, userGroupId string, userIds []string) (err error)

UGUserGroupUserDelete 用户组批量移除用户

func (*RongCloud) UGUserUserGroupQuery

func (rc *RongCloud) UGUserUserGroupQuery(groupId, userId string, page, pageSize int) (userGroupIds []string, err error)

UGUserUserGroupQuery 查询用户在超级群下所属的用户组列表

func (*RongCloud) UltraGroupBannedWhiteListAdd

func (rc *RongCloud) UltraGroupBannedWhiteListAdd(groupId, busChannel string, userIds ...string) error

UltraGroupBannedWhiteListAdd 添加禁言白名单

func (*RongCloud) UltraGroupBannedWhiteListDel

func (rc *RongCloud) UltraGroupBannedWhiteListDel(groupId, busChannel string, userIds ...string) error

UltraGroupBannedWhiteListDel 移除禁言白名单

func (*RongCloud) UltraGroupBannedWhiteListGet

func (rc *RongCloud) UltraGroupBannedWhiteListGet(groupId, busChannel string, page, pageSize int) ([]UltraGroupBannedWhiteListGetResponseItem, error)

UltraGroupBannedWhiteListGet 获取禁言白名单

func (*RongCloud) UltraGroupChannelCreate

func (rc *RongCloud) UltraGroupChannelCreate(groupId, busChannel string) error

UltraGroupChannelCreate 创建频道

func (*RongCloud) UltraGroupChannelDel

func (rc *RongCloud) UltraGroupChannelDel(groupId, busChannel string) error

UltraGroupChannelDel 删除频道

func (*RongCloud) UltraGroupChannelGet

func (rc *RongCloud) UltraGroupChannelGet(groupId string, page, limit int) ([]UltraGroupChannelGetResponseItem, error)

UltraGroupChannelGet 查询频道列表 response:[]UltraGroupChannelGetResponseItem

func (*RongCloud) UltraGroupCreate

func (rc *RongCloud) UltraGroupCreate(userId, groupId, groupName string) error

UltraGroupCreate 创建超级群

func (*RongCloud) UltraGroupDis

func (rc *RongCloud) UltraGroupDis(groupId string) error

UltraGroupDis 解散超级群

func (*RongCloud) UltraGroupGlobalBannedGet

func (rc *RongCloud) UltraGroupGlobalBannedGet(groupId, busChannel string) (bool, error)

UltraGroupGlobalBannedGet 查询超级群禁言状态

func (*RongCloud) UltraGroupGlobalBannedSet

func (rc *RongCloud) UltraGroupGlobalBannedSet(groupId, busChannel string, status bool) error

UltraGroupGlobalBannedSet 设置超级群禁言状态

func (*RongCloud) UltraGroupJoin

func (rc *RongCloud) UltraGroupJoin(userId, groupId string) error

UltraGroupJoin 加入超级群

func (*RongCloud) UltraGroupQuit

func (rc *RongCloud) UltraGroupQuit(userId, groupId string) error

UltraGroupQuit 退出超级群

func (*RongCloud) UltraGroupRefresh

func (rc *RongCloud) UltraGroupRefresh(groupId, groupName string) error

UltraGroupRefresh 刷新超级群信息

func (*RongCloud) UltraGroupUserBannedAdd

func (rc *RongCloud) UltraGroupUserBannedAdd(groupId, busChannel string, userIds ...string) error

UltraGroupUserBannedAdd 添加禁言成员

func (*RongCloud) UltraGroupUserBannedDel

func (rc *RongCloud) UltraGroupUserBannedDel(groupId, busChannel string, userIds ...string) error

UltraGroupUserBannedDel 移除禁言成员

func (*RongCloud) UltraGroupUserBannedGet

func (rc *RongCloud) UltraGroupUserBannedGet(groupId, busChannel string, page, pageSize int) ([]UltraGroupUserBannedResponseItem, error)

UltraGroupUserBannedGet 获取禁言成员

func (*RongCloud) UserBlockPushPeriodDelete

func (rc *RongCloud) UserBlockPushPeriodDelete(userId string) error

UserBlockPushPeriodDelete 删除用户免打扰时段 /user/blockPushPeriod/delete.json * @param: userId 用户id,必传

*//

func (*RongCloud) UserBlockPushPeriodGet

func (rc *RongCloud) UserBlockPushPeriodGet(userId string) (PushPeriodGet, error)

UserBlockPushPeriodGet UserBlockPushPeriodGet: 查用户免打扰时段 /user/blockPushPeriod/get.json * @param: userId 用户id,必传

response : PushPeriodGet

*//

func (*RongCloud) UserBlockPushPeriodSet

func (rc *RongCloud) UserBlockPushPeriodSet(userId, startTime, period, level string) error

UserBlockPushPeriodSet :添加户免打扰时段 /user/blockPushPeriod/set.json *

@param :userId 用户ID  必传
@param :startTime 开始时间(秒) 必传
@param :period  时段 (分钟)     必传
@param :level   免打扰级别  默认 1  不是必传
form表单

*//

func (*RongCloud) UserChatFbQueryList

func (rc *RongCloud) UserChatFbQueryList(num, offset int, t string) ([]byte, error)

UserChatFbQueryList * /user/chat/fb/querylist 查询禁言用户列表 @param: num :获取行数,默认为 100,最大支持 200 个 @param: offset :查询开始位置,默认为 0。 @param: t :会话类型,目前支持单聊会话 PERSON。 response: 返回byte数组 https://doc.rongcloud.cn/imserver/server/v1/user/ban */

func (*RongCloud) UserChatFbQueryListResObj

func (rc *RongCloud) UserChatFbQueryListResObj(num, offset int, t string) (UserChatFbQueryListObj, error)

UserChatFbQueryListResObj * /user/chat/fb/querylist 查询禁言用户列表 @param: num :获取行数,默认为 100,最大支持 200 个 @param: offset :查询开始位置,默认为 0。 @param: t :会话类型,目前支持单聊会话 PERSON。 response: UserChatFbQueryListObj 文档: https://doc.rongcloud.cn/imserver/server/v1/user/ban */

func (*RongCloud) UserChatFbSet

func (rc *RongCloud) UserChatFbSet(userId string, state int, t string) error

UserChatFbSet * 用户单聊禁言 @param: userId :被禁言用户 ID,支持批量设置,最多不超过 1000 个 @param: state :禁言状态,0 解除禁言、1 添加禁言 @param: type :会话类型,目前支持单聊会话 PERSON */

func (*RongCloud) UserDeactivate

func (rc *RongCloud) UserDeactivate(userIds []string) (*UserDeactivateResponse, error)

UserDeactivate 注销用户 @param userIds []string 被注销用户 ID,最多一次 100 个 @return string, error official doc https://doc.rongcloud.cn/imserver/server/v1/user/deactivate 发起注销后,服务端会在 15 分钟内通过回调通知注销结果。 https://doc.rongcloud.cn/imserver/server/v1/user/callback-deactivation

func (*RongCloud) UserDeactivateQuery

func (rc *RongCloud) UserDeactivateQuery(pageNo, pageSize int) (*UserDeactivateQueryResponse, error)

UserDeactivateQuery 查询已注销用户 @param pageNo 分页获取注销用户列表时的当前页数,默认 1,最小 1。 @param pageSize 分页获取注销用户列表时的每页行数,默认 50,最小 1,最大 50。 @return string, error official doc https://doc.rongcloud.cn/imserver/server/v1/user/query-deactivated-list

func (*RongCloud) UserReactivate

func (rc *RongCloud) UserReactivate(userIds []string) (*UserReactivateResponse, error)

UserReactivate 重新激活注销用户 @param userIds []string 激活用户 ID,单次请求最多传入 100 个用户 ID。 @return string, error official doc https://doc.rongcloud.cn/imserver/server/v1/user/reactivate 重新激活用户请通过(https://doc.rongcloud.cn/imserver/server/v1/user/callback-deactivation)接口获取重新激活结果。重复调用此接口不会报错。

func (*RongCloud) UserRegister

func (rc *RongCloud) UserRegister(userID, name, portraitURI string) (User, error)

UserRegister 注册用户,生成用户在融云的唯一身份标识 Token

*@param userID:用户 ID,最大长度 64 字节.是用户在 App 中的唯一标识码,必须保证在同一个 App 内不重复,重复的用户 Id 将被当作是同一用户。 *@param name:用户名称,最大长度 128 字节.用来在 Push 推送时显示用户的名称.用户名称,最大长度 128 字节.用来在 Push 推送时显示用户的名称。 *@param portraitURI:用户头像 URI,最大长度 1024 字节.用来在 Push 推送时显示用户的头像。可以为空 * *@return User, error

func (*RongCloud) UserRemarksDel

func (rc *RongCloud) UserRemarksDel(userId, targetId string) error

UserRemarksDel /user/remarks/del.json 删除用户级送备注名 *

@param: userId :操作者用户ID。
@param: targetId:需要删除推送备注名的用户 ID

*/

func (*RongCloud) UserRemarksGet

func (rc *RongCloud) UserRemarksGet(userId string, page, size int) ([]byte, error)

UserRemarksGet /user/remarks/get.json 查询用户级送备注名 *

@param: userId :用户ID。
@param: page :页数,默认为第一页。
@param: size :每页条数,默认每页 50 条

response :byte数组 文档:https://doc.rongcloud.cn/imserver/server/v1/user/get-remark-for-push */

func (*RongCloud) UserRemarksGetResObj

func (rc *RongCloud) UserRemarksGetResObj(userId string, page, size int) (UserRemarksGetObj, error)

UserRemarksGetResObj /user/remarks/get.json 查询用户级送备注名 *

@param: userId :用户ID。
@param: page :页数,默认为第一页。
@param: size :每页条数,默认每页 50 条
response: UserRemarksGetObj
文档:https://doc.rongcloud.cn/imserver/server/v1/user/get-remark-for-push

*/

func (*RongCloud) UserRemarksSet

func (rc *RongCloud) UserRemarksSet(userId string, remarks []UserRemark) error

UserRemarksSet /user/remarks/set.json * @param: userId:用户 ID。 @param: remarks:设置的目标用户推送备注名 JSON 字符串

*/

func (*RongCloud) UserTokenExpire

func (rc *RongCloud) UserTokenExpire(userId string, t int64) ([]byte, error)

UserTokenExpire /user/token/expire.json Token 失效 *

@param: userId: 必传 需要设置 Token 失效的用户 ID,支持设置多个最多不超过 20 个
@param: time: 必传 过期时间戳精确到毫秒,该时间戳前用户获取的 Token 全部失效,使用时间戳之前的 Token 已经在连接中的用户不会立即失效,断开后无法进行连接。
response: byte数组
文档 :https://doc.rongcloud.cn/imserver/server/v1/user/expire

*//

func (*RongCloud) UserTokenExpireResObj

func (rc *RongCloud) UserTokenExpireResObj(userId string, t int64) (UserTokenExpireObj, error)

UserTokenExpireResObj /user/token/expire.json Token 失效 *

@param: userId: 必传 需要设置 Token 失效的用户 ID,支持设置多个最多不超过 20 个
@param: time: 必传 过期时间戳精确到毫秒,该时间戳前用户获取的 Token 全部失效,使用时间戳之前的 Token 已经在连接中的用户不会立即失效,断开后无法进行连接。
response: UserTokenExpireObj
文档: https://doc.rongcloud.cn/imserver/server/v1/user/expire

*//

func (*RongCloud) UserUpdate

func (rc *RongCloud) UserUpdate(userID, name, portraitURI string) error

UserUpdate 修改用户信息

*@param userID:用户 ID,最大长度 64 字节.是用户在 App 中的唯一标识码,必须保证在同一个 App 内不重复,重复的用户 Id 将被当作是同一用户。 *@param name:用户名称,最大长度 128 字节。用来在 Push 推送时,显示用户的名称,刷新用户名称后 5 分钟内生效。(可选,提供即刷新,不提供忽略) *@param portraitURI:用户头像 URI,最大长度 1024 字节。用来在 Push 推送时显示。(可选,提供即刷新,不提供忽略) * *@return error

type Sender

type Sender interface {
	// contains filtered or unexported methods
}

Sender 广播推送接口

type SensitiveWord

type SensitiveWord struct {
	Type        string `json:"type"`
	Word        string `json:"word"`
	ReplaceWord string `json:"replaceWord"`
}

SensitiveWord 敏感词

type TXTMsg

type TXTMsg struct {
	Content string      `json:"content"`
	User    MsgUserInfo `json:"user"`
	Extra   string      `json:"extra"`
}

TXTMsg 消息

func (*TXTMsg) ToString

func (msg *TXTMsg) ToString() (string, error)

ToString TXTMsg

type Tag

type Tag struct {
	UserID string   `json:"userId"` // 用户 Id。(必传)
	Tags   []string `json:"tags"`   // 用户标签,一个用户最多添加 20 个标签,每个 tag 最大不能超过 40 个字节,标签中不能包含特殊字符。(必传)
}

Tag TagSet 参数

type TagBatch

type TagBatch struct {
	UserIDs []string `json:"userIds"` // 用户 Id,一次最多支持 1000 个用户。(必传)
	Tags    []string `json:"tags"`    // 用户标签,一个用户最多添加 20 个标签,每个 tag 最大不能超过 40 个字节,标签中不能包含特殊字符。(必传)
}

TagBatch TagBatchSet 参数

type TagResult

type TagResult struct {
	*CodeResult
	Result map[string][]string `json:"result"` // 用户所有的标签数组。
}

TagResult TagGet 返回值

type TemplateMsgContent

type TemplateMsgContent struct {
	TargetID    string
	Data        map[string]string
	PushContent string
	PushData    string
}

TemplateMsgContent 消息模版

type UGChannelInfo

type UGChannelInfo struct {
	ChannelId  string `json:"channel_id"`
	CreateTime string `json:"create_time"`
}

超级群 频道信息

type UGChannelPrivateUserAddObj

type UGChannelPrivateUserAddObj struct {
	Code int `json:"code"`
}

type UGChannelPrivateUserDelObj

type UGChannelPrivateUserDelObj struct {
	Code int `json:"code"`
}

type UGChannelPrivateUserGetObj

type UGChannelPrivateUserGetObj struct {
	Code  int      `json:"code"`
	Users []string `json:"users"`
}

UGChannelPrivateUserGetObj : UGChannelPrivateUserGetResObj的返回值

type UGGroupChannelChangeObj

type UGGroupChannelChangeObj struct {
	Code int `json:"code"`
}

type UGGroupInfo

type UGGroupInfo struct {
	GroupId   string `json:"group_id"`
	GroupName string `json:"group_name"`
}

超级群 群组信息

type UGHisMsgIdQueryData

type UGHisMsgIdQueryData struct {
	GroupId        string `json:"groupId"`
	BusChannel     string `json:"busChannel"`
	FromUserId     string `json:"fromUserId"`
	MsgUID         string `json:"msgUID"`
	MsgTime        int64  `json:"msgTime"`
	ObjectName     string `json:"objectName"`
	ConversionType int    `json:"conversionType"`
	Content        string `json:"content"`
	Expansion      bool   `json:"expansion"`
	ExtraContent   string `json:"extraContent"`
}

type UGHisMsgIdQueryResp

type UGHisMsgIdQueryResp struct {
	Code int                   `json:"code"`
	Data []UGHisMsgIdQueryData `json:"data"`
}

type UGHisMsgQueryData

type UGHisMsgQueryData struct {
	GroupId        string `json:"groupId"`
	BusChannel     string `json:"busChannel"`
	FromUserId     string `json:"fromUserId"`
	MsgUID         string `json:"msgUID"`
	MsgTime        int64  `json:"msgTime"`
	ObjectName     string `json:"objectName"`
	ConversionType int    `json:"conversionType"`
	Content        string `json:"content"`
	Expansion      bool   `json:"expansion"`
	ExtraContent   string `json:"extraContent"`
}

type UGHisMsgQueryResp

type UGHisMsgQueryResp struct {
	Code int                 `json:"code"`
	Data []UGHisMsgQueryData `json:"data"`
}

type UGMessage

type UGMessage struct {
	FromUserId          string   `json:"from_user_id"`
	ToGroupIds          []string `json:"to_group_ids"`
	ToUserIds           []string `json:"to_user_ids,omitempty"`
	ObjectName          string   `json:"object_name"`
	Content             string   `json:"content"`
	PushContent         string   `json:"push_content,omitempty"`
	PushData            string   `json:"push_data,omitempty"`
	IncludeSenderEnable bool     `json:"include_sender_enable,omitempty"`
	StoreFlag           bool     `json:"store_flag"`
	MentionedFlag       bool     `json:"mentioned_flag,omitempty"`
	SilencePush         bool     `json:"silence_push,omitempty"`
	PushExt             string   `json:"push_ext,omitempty"`
	BusChannel          string   `json:"bus_channel,omitempty"`
}

超级群 消息结构

type UGMessageData

type UGMessageData struct {
	// 消息唯一标识 ID
	MsgUid string `json:"msgUID"`

	// 频道 Id,支持英文字母、数字组合,最长为 20 个字符
	BusChannel string `json:"busChannel,omitempty"`
}

UGMessageData :UGMessageGet方法中的消息参数数组

type UGMessageExpansionItem

type UGMessageExpansionItem struct {
	Key       string `json:"key"`
	Value     string `json:"value"`
	Timestamp int64  `json:"timestamp"`
}

type UGMessageGetData

type UGMessageGetData struct {
	Code int                    `json:"code"`
	Data []UGMessageGetDataList `json:"data"`
}

type UGMessageGetDataList

type UGMessageGetDataList struct {
	FromUserId   string `json:"fromUserId"`
	GroupId      string `json:"groupId"`
	SentTime     uint64 `json:"sentTime"`
	BusChannel   string `json:"busChannel"`
	MsgUid       string `json:"msgUID"`
	ObjectName   string `json:"objectName"`
	Content      string `json:"content"`
	Expansion    bool   `json:"expansion"`
	ExtraContent string `json:"extraContent"`
}

type UGNotDisturbGetResponses

type UGNotDisturbGetResponses struct {
	GroupId     string `json:"groupId"`
	BusChannel  string `json:"busChannel"`
	UnPushLevel int    `json:"unpushLevel"`
}

type UGUserGroupInfo

type UGUserGroupInfo struct {
	UserGroupId string `json:"userGroupId"`
}

超级群 用户组信息

type UGUserInfo

type UGUserInfo struct {
	Id        string `json:"id"`
	MutedTime string `json:"time"`
}

超级群 用户信息

type UgMessageExtension

type UgMessageExtension struct {
	// 频道 Id,支持英文字母、数字组合,最长为 20 个字符
	BusChannel string

	// 请求唯一标识,,保证一分钟之内的请求幂等
	MsgRandom int64
}

UgMessageExtension :根据消息 ID 批量获取超级群消息的扩展消息,可选填

type UltraGroupBannedWhiteListGetResponseItem

type UltraGroupBannedWhiteListGetResponseItem struct {
	Id string `json:"id"`
}

type UltraGroupChannelGetResponseItem

type UltraGroupChannelGetResponseItem struct {
	ChannelId  string `json:"channelId"`
	Type       int    `json:"type"`
	CreateTime string `json:"createTime"`
}

type UltraGroupUserBannedResponseItem

type UltraGroupUserBannedResponseItem struct {
	Id string `json:"id"`
}

type User

type User struct {
	Token        string `json:"token"`
	UserID       string `json:"userId"`
	BlockEndTime string `json:"blockEndTime,omitempty"`
	Status       string `json:"status,omitempty"`
}

User 用户信息 返回信息

type UserChatFbQueryListObj

type UserChatFbQueryListObj struct {
	// 返回码,200 为正常。
	Code int `json:"code"`

	// 被禁言用户总数。
	Total int `json:"total"`

	// 被禁言用户数组。
	Users []string `json:"users"`
}

UserChatFbQueryListObj : 的返回结果

type UserDeactivateQueryResponse

type UserDeactivateQueryResponse struct {
	Code  int      `json:"code"`  // 返回码,200 为正常
	Users []string `json:"users"` // 已注销的用户 ID 列表
}

type UserDeactivateResponse

type UserDeactivateResponse struct {
	Code      int    `json:"code"`
	OperateId string `json:"operateId"` // 操作 ID,为当前操作的唯一标识。开通用户注销与激活状态回调后,回调请求正文中会携带此参数。
}

type UserReactivateResponse

type UserReactivateResponse struct {
	Code      int    `json:"code"`      // 返回码,200 为正常。每个用户 ID 操作结果通过用户注销与激活状态回调传递。
	OperateId string `json:"operateId"` // 操作 ID,为当前操作的唯一标识。开通用户注销与激活状态回调后,回调请求正文中会携带此参数。
}

type UserRemark

type UserRemark struct {
	// 目标用户 ID。单次最多设置 100 个
	Id string

	// 收到目标用户推送时显示的备注名。
	Remark string
}

UserRemark :UserRemarksSet方法接收的参数

type UserRemarksGetObj

type UserRemarksGetObj struct {
	// 返回码,200 为正常。
	Code int `json:"code"`

	// 用户的备注名总数。
	Total int `json:"total"`

	// JSON 对象数组,包含用户 ID(id)和对应的备注名(remark)。单次最多返回 50 个用户备注名。
	Users []UserRemarksUsers `json:"users"`
}

UserRemarksGetObj :UserRemarksGetResObj 的返回值

type UserRemarksUsers

type UserRemarksUsers struct {
	// 用户id
	Id string `json:"id"`

	// 备注名字
	Remark string `json:"remark"`
}

type UserTokenExpireObj

type UserTokenExpireObj struct {
	// 返回码,200 为正常
	Code int `json:"code"`
}

UserTokenExpireObj :的返回值定义

type VCMsg

type VCMsg struct {
	Content  string      `json:"content"`
	User     MsgUserInfo `json:"user"`
	Extra    string      `json:"extra"`
	Duration interface{} `json:"duration"`
}

VCMsg 消息

func (*VCMsg) ToString

func (msg *VCMsg) ToString() (string, error)

ToString VCMsg

type WhiteList

type WhiteList struct {
	Users []string `json:"users"`
}

WhiteList QueryWhiteList 返回数据

Jump to

Keyboard shortcuts

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