Documentation
¶
Index ¶
- Constants
- Variables
- type BatchSendRoomUnicast
- type BatchSendRoomUnicastBody
- type BatchSendRoomUnicastQuery
- type BatchSendRoomUnicastReq
- type BatchSendRoomUnicastRes
- type BatchSendRoomUnicastResResponseMetadata
- type BatchSendRoomUnicastResResponseMetadataError
- type BatchSendRoomUnicastResResult
- type Event20231101
- type Event20231101SubEventsItem
- type IndicatorTag
- type IndicatorTag202201
- type IndicatorTag202201SubTagsItem
- type IndicatorTagSubTagsItem
- type Rtc
- func (c *Rtc) BatchSendRoomUnicast(ctx context.Context, arg *BatchSendRoomUnicastBody) (*BatchSendRoomUnicastRes, int, error)
- func (c *Rtc) SendBroadcast(ctx context.Context, arg *SendBroadcastBody) (*SendBroadcastRes, int, error)
- func (c *Rtc) SendRoomUnicast(ctx context.Context, arg *SendRoomUnicastBody) (*SendRoomUnicastRes, int, error)
- func (c *Rtc) SendUnicast(ctx context.Context, arg *SendUnicastBody) (*SendUnicastRes, int, error)
- type SendBroadcast
- type SendBroadcastBody
- type SendBroadcastQuery
- type SendBroadcastReq
- type SendBroadcastRes
- type SendBroadcastResResponseMetadata
- type SendBroadcastResResponseMetadataError
- type SendBroadcastResResult
- type SendRoomUnicast
- type SendRoomUnicastBody
- type SendRoomUnicastQuery
- type SendRoomUnicastReq
- type SendRoomUnicastRes
- type SendRoomUnicastResResponseMetadata
- type SendRoomUnicastResResponseMetadataError
- type SendRoomUnicastResResult
- type SendUnicast
- type SendUnicastBody
- type SendUnicastQuery
- type SendUnicastReq
- type SendUnicastRes
- type SendUnicastResResponseMetadata
- type SendUnicastResResponseMetadataError
- type SendUnicastResResult
Constants ¶
View Source
const ( ServiceName = "rtc" DefaultTimeout = 10 * time.Second )
Variables ¶
View Source
var ( ServiceInfoMap = map[string]common.ServiceInfo{ "cn-north-1": { Timeout: DefaultTimeout, Scheme: "https", Host: "rtc.volcengineapi.com", Header: http.Header{ "Accept": []string{"application/json"}, }, Credentials: common.Credentials{ Region: "cn-north-1", Service: ServiceName, }, }, } ApiListInfo = map[string]*common.ApiInfo{ "SendBroadcast": { Method: http.MethodPost, Path: "/", Query: url.Values{ "Action": []string{"SendBroadcast"}, "Version": []string{"2023-07-20"}, }, }, "SendRoomUnicast": { Method: http.MethodPost, Path: "/", Query: url.Values{ "Action": []string{"SendRoomUnicast"}, "Version": []string{"2023-07-20"}, }, }, "SendUnicast": { Method: http.MethodPost, Path: "/", Query: url.Values{ "Action": []string{"SendUnicast"}, "Version": []string{"2023-07-20"}, }, }, "BatchSendRoomUnicast": { Method: http.MethodPost, Path: "/", Query: url.Values{ "Action": []string{"BatchSendRoomUnicast"}, "Version": []string{"2023-07-20"}, }, }, } )
Functions ¶
This section is empty.
Types ¶
type BatchSendRoomUnicast ¶
type BatchSendRoomUnicast struct{}
type BatchSendRoomUnicastBody ¶
type BatchSendRoomUnicastBody struct {
// REQUIRED; 你的音视频应用的唯一标志,参看获取 AppId [https://www.volcengine.com/docs/6348/69865#%E6%AD%A5%E9%AA%A44%EF%BC%9A%E5%88%9B%E5%BB%BA-rtc-%E5%BA%94%E7%94%A8%EF%BC%8C%E8%8E%B7%E5%8F%96-appid]。
AppID string `json:"AppId"`
// REQUIRED; 消息类型。
// * true:二进制消息。false:文本消息。
Binary bool `json:"Binary"`
// REQUIRED; 业务服务端的唯一标识。 命名规则符合正则表达式:[a-zA-Z0-9_@\-\.]{1,128}。 在一个 AppID 下,不能和真实用户用于实时消息通信的 user_ID 重复。 建议使用固定的 ID 的发送消息。
From string `json:"From"`
// REQUIRED; 点对点消息 。如果是二进制消息,需进行 base64 编码
Message string `json:"Message"`
// REQUIRED; 房间 ID,是房间的唯一标志
RoomID string `json:"RoomId"`
// REQUIRED; 消息接收者的 user_ID
To []string `json:"To"`
}
type BatchSendRoomUnicastQuery ¶
type BatchSendRoomUnicastQuery struct{}
type BatchSendRoomUnicastReq ¶
type BatchSendRoomUnicastReq struct {
*BatchSendRoomUnicastQuery
*BatchSendRoomUnicastBody
}
type BatchSendRoomUnicastRes ¶
type BatchSendRoomUnicastRes struct {
// REQUIRED
ResponseMetadata BatchSendRoomUnicastResResponseMetadata `json:"ResponseMetadata"`
// REQUIRED; 返回值 Result 仅在请求成功时返回消息 success ,表示服务端成功接收到消息,失败时为空。
Result BatchSendRoomUnicastResResult `json:"Result"`
}
type BatchSendRoomUnicastResResponseMetadata ¶
type BatchSendRoomUnicastResResponseMetadata struct {
// REQUIRED
Action string `json:"Action"`
// REQUIRED
Region string `json:"Region"`
// REQUIRED
RequestID string `json:"RequestId"`
// REQUIRED
Service string `json:"Service"`
// REQUIRED
Version string `json:"Version"`
// 仅在请求失败时返回。
Error *BatchSendRoomUnicastResResponseMetadataError `json:"Error,omitempty"`
}
type BatchSendRoomUnicastResResponseMetadataError ¶
type BatchSendRoomUnicastResResponseMetadataError struct {
// REQUIRED; API 的错误码
Code string `json:"Code"`
// REQUIRED; 具体的错误信息
Message string `json:"Message"`
// 网关的错误码。(请求失败时返回)
CodeN *int32 `json:"CodeN,omitempty"`
}
BatchSendRoomUnicastResResponseMetadataError - 仅在请求失败时返回。
type BatchSendRoomUnicastResResult ¶
type BatchSendRoomUnicastResResult struct {
// REQUIRED; 请求成功时返回消息Success,表示服务端成功接收到消息,失败时返回具体错误信息。
Message string `json:"Message"`
}
BatchSendRoomUnicastResResult - 返回值 Result 仅在请求成功时返回消息 success ,表示服务端成功接收到消息,失败时为空。
type Event20231101 ¶
type Event20231101 struct {
// 原因,只有error事件有
Cause *string `json:"Cause,omitempty"`
// 事件描述
Description *string `json:"Description,omitempty"`
// 原始日志信息,这一期不做在前端展示
Detail *string `json:"Detail,omitempty"`
// 展示名
DisplayName *string `json:"DisplayName,omitempty"`
// 事件级别 Info、Warning、Error
Level *int64 `json:"Level,omitempty"`
// 事件名,英文
Name *string `json:"Name,omitempty"`
// 子事件,构成该聚合事件的事件,这一期不做在前端展示
SubEvents []*Event20231101SubEventsItem `json:"SubEvents,omitempty"`
// 标签
Tags []*string `json:"Tags,omitempty"`
// 事件时间,若为聚合类事件,取最大时间
Time *int64 `json:"Time,omitempty"`
}
type Event20231101SubEventsItem ¶
type Event20231101SubEventsItem struct {
// 原因,只有error事件有
Cause *string `json:"Cause,omitempty"`
// 事件描述
Description *string `json:"Description,omitempty"`
// 原始日志信息,这一期不做在前端展示
Detail *string `json:"Detail,omitempty"`
// 展示名
DisplayName *string `json:"DisplayName,omitempty"`
// 事件级别 Info、Warning、Error
Level *int64 `json:"Level,omitempty"`
// 事件名,英文
Name *string `json:"Name,omitempty"`
// 子事件,构成该聚合事件的事件,这一期不做在前端展示
SubEvents []*Event20231101 `json:"SubEvents,omitempty"`
// 标签
Tags []*string `json:"Tags,omitempty"`
// 事件时间,若为聚合类事件,取最大时间
Time *int64 `json:"Time,omitempty"`
}
type IndicatorTag ¶
type IndicatorTag struct {
Alias *string `json:"Alias,omitempty"`
// 是否隐藏掉地域分布信息,注意这个参数只有在质量概览模块有效
HidenDistribution *bool `json:"HidenDistribution,omitempty"`
IsPositive *bool `json:"IsPositive,omitempty"`
Name *string `json:"Name,omitempty"`
// 可以使用采样归因功能
SampleAvailable *bool `json:"SampleAvailable,omitempty"`
SubTags []*IndicatorTagSubTagsItem `json:"SubTags,omitempty"`
// 是否支持用户分析
SupportDetailAnalysis *bool `json:"SupportDetailAnalysis,omitempty"`
// 用量统计是否支持切换新旧展示类型
SupportSwitchDisplayType *bool `json:"SupportSwitchDisplayType,omitempty"`
// 是否支持用户占比统计
SupportUserProportion *bool `json:"SupportUserProportion,omitempty"`
// 分布统计中取topN
TopN *int64 `json:"TopN,omitempty"`
// 分布统计中只取在这里面的值
ValueDict []*string `json:"ValueDict,omitempty"`
// 是否在控制台可见,若是,则在后面加🌟
VisibleOnConsole *bool `json:"VisibleOnConsole,omitempty"`
}
type IndicatorTag202201 ¶
type IndicatorTag202201 struct {
Alias *string `json:"Alias,omitempty"`
// 是否隐藏掉地域分布信息,注意这个参数只有在质量概览模块有效
HidenDistribution *bool `json:"HidenDistribution,omitempty"`
IsPositive *bool `json:"IsPositive,omitempty"`
Name *string `json:"Name,omitempty"`
// 可以使用采样归因功能
SampleAvailable *bool `json:"SampleAvailable,omitempty"`
SubTags []*IndicatorTag202201SubTagsItem `json:"SubTags,omitempty"`
// 是否支持用户分析
SupportDetailAnalysis *bool `json:"SupportDetailAnalysis,omitempty"`
// 用量统计是否支持切换新旧展示类型
SupportSwitchDisplayType *bool `json:"SupportSwitchDisplayType,omitempty"`
// 是否支持用户占比统计
SupportUserProportion *bool `json:"SupportUserProportion,omitempty"`
// 分布统计中取topN
TopN *int64 `json:"TopN,omitempty"`
// 分布统计中只取在这里面的值
ValueDict []*string `json:"ValueDict,omitempty"`
// 是否在控制台可见,若是,则在后面加🌟
VisibleOnConsole *bool `json:"VisibleOnConsole,omitempty"`
}
type IndicatorTag202201SubTagsItem ¶
type IndicatorTag202201SubTagsItem struct {
Alias *string `json:"Alias,omitempty"`
// 是否隐藏掉地域分布信息,注意这个参数只有在质量概览模块有效
HidenDistribution *bool `json:"HidenDistribution,omitempty"`
IsPositive *bool `json:"IsPositive,omitempty"`
Name *string `json:"Name,omitempty"`
// 可以使用采样归因功能
SampleAvailable *bool `json:"SampleAvailable,omitempty"`
SubTags []*IndicatorTag202201 `json:"SubTags,omitempty"`
// 是否支持用户分析
SupportDetailAnalysis *bool `json:"SupportDetailAnalysis,omitempty"`
// 用量统计是否支持切换新旧展示类型
SupportSwitchDisplayType *bool `json:"SupportSwitchDisplayType,omitempty"`
// 是否支持用户占比统计
SupportUserProportion *bool `json:"SupportUserProportion,omitempty"`
// 分布统计中取topN
TopN *int64 `json:"TopN,omitempty"`
// 分布统计中只取在这里面的值
ValueDict []*string `json:"ValueDict,omitempty"`
// 是否在控制台可见,若是,则在后面加🌟
VisibleOnConsole *bool `json:"VisibleOnConsole,omitempty"`
}
type IndicatorTagSubTagsItem ¶
type IndicatorTagSubTagsItem struct {
Alias *string `json:"Alias,omitempty"`
// 是否隐藏掉地域分布信息,注意这个参数只有在质量概览模块有效
HidenDistribution *bool `json:"HidenDistribution,omitempty"`
IsPositive *bool `json:"IsPositive,omitempty"`
Name *string `json:"Name,omitempty"`
// 可以使用采样归因功能
SampleAvailable *bool `json:"SampleAvailable,omitempty"`
SubTags []*IndicatorTag `json:"SubTags,omitempty"`
// 是否支持用户分析
SupportDetailAnalysis *bool `json:"SupportDetailAnalysis,omitempty"`
// 用量统计是否支持切换新旧展示类型
SupportSwitchDisplayType *bool `json:"SupportSwitchDisplayType,omitempty"`
// 是否支持用户占比统计
SupportUserProportion *bool `json:"SupportUserProportion,omitempty"`
// 分布统计中取topN
TopN *int64 `json:"TopN,omitempty"`
// 分布统计中只取在这里面的值
ValueDict []*string `json:"ValueDict,omitempty"`
// 是否在控制台可见,若是,则在后面加🌟
VisibleOnConsole *bool `json:"VisibleOnConsole,omitempty"`
}
type Rtc ¶
func NewInstance ¶
func NewInstance() *Rtc
func NewInstanceWithRegion ¶
func (*Rtc) BatchSendRoomUnicast ¶
func (c *Rtc) BatchSendRoomUnicast(ctx context.Context, arg *BatchSendRoomUnicastBody) (*BatchSendRoomUnicastRes, int, error)
func (*Rtc) SendBroadcast ¶
func (c *Rtc) SendBroadcast(ctx context.Context, arg *SendBroadcastBody) (*SendBroadcastRes, int, error)
func (*Rtc) SendRoomUnicast ¶
func (c *Rtc) SendRoomUnicast(ctx context.Context, arg *SendRoomUnicastBody) (*SendRoomUnicastRes, int, error)
func (*Rtc) SendUnicast ¶
func (c *Rtc) SendUnicast(ctx context.Context, arg *SendUnicastBody) (*SendUnicastRes, int, error)
type SendBroadcast ¶
type SendBroadcast struct{}
type SendBroadcastBody ¶
type SendBroadcastBody struct {
// REQUIRED; 你的音视频应用的唯一标志,参看获取 AppId [https://www.volcengine.com/docs/6348/69865#%E6%AD%A5%E9%AA%A44%EF%BC%9A%E5%88%9B%E5%BB%BA-rtc-%E5%BA%94%E7%94%A8%EF%BC%8C%E8%8E%B7%E5%8F%96-appid]。
AppID string `json:"AppId"`
// REQUIRED; 消息类型。
// * true:二进制消息。false:文本消息。
Binary bool `json:"Binary"`
// REQUIRED; 业务服务端的唯一标识; 命名规则符合正则表达式:[a-zA-Z0-9_@\-\.]{1,128}。 在一个 AppID 下,不能和真实用户用于实时消息通信的 user_ID 重复; 建议使用固定的 ID 的发送消息。
From string `json:"From"`
// REQUIRED; 广播消息内容。如果是二进制消息,需进行 base64 编码
Message string `json:"Message"`
// REQUIRED; 房间的 ID,是房间的唯一标志
RoomID string `json:"RoomId"`
}
type SendBroadcastQuery ¶
type SendBroadcastQuery struct{}
type SendBroadcastReq ¶
type SendBroadcastReq struct {
*SendBroadcastQuery
*SendBroadcastBody
}
type SendBroadcastRes ¶
type SendBroadcastRes struct {
// REQUIRED
ResponseMetadata SendBroadcastResResponseMetadata `json:"ResponseMetadata"`
// REQUIRED
Result SendBroadcastResResult `json:"Result"`
}
type SendBroadcastResResponseMetadata ¶
type SendBroadcastResResponseMetadata struct {
// REQUIRED
Action string `json:"Action"`
// REQUIRED
Region string `json:"Region"`
// REQUIRED
RequestID string `json:"RequestId"`
// REQUIRED
Service string `json:"Service"`
// REQUIRED
Version string `json:"Version"`
// 仅在请求失败时返回。
Error *SendBroadcastResResponseMetadataError `json:"Error,omitempty"`
}
type SendBroadcastResResponseMetadataError ¶
type SendBroadcastResResponseMetadataError struct {
// REQUIRED; API 的错误码
Code string `json:"Code"`
// REQUIRED; 具体的错误信息
Message string `json:"Message"`
// 网关的错误码。(请求失败时返回)
CodeN *int32 `json:"CodeN,omitempty"`
}
SendBroadcastResResponseMetadataError - 仅在请求失败时返回。
type SendBroadcastResResult ¶
type SendBroadcastResResult struct {
// REQUIRED; 请求成功时返回消息Success,表示服务端成功接收到消息,失败时返回具体错误信息。
Message string `json:"Message"`
}
type SendRoomUnicast ¶
type SendRoomUnicast struct{}
type SendRoomUnicastBody ¶
type SendRoomUnicastBody struct {
// REQUIRED; 你的音视频应用的唯一标志,参看获取 AppId [https://www.volcengine.com/docs/6348/69865#%E6%AD%A5%E9%AA%A44%EF%BC%9A%E5%88%9B%E5%BB%BA-rtc-%E5%BA%94%E7%94%A8%EF%BC%8C%E8%8E%B7%E5%8F%96-appid]。
AppID string `json:"AppId"`
// REQUIRED; 消息类型。
// * true:二进制消息。false:文本消息。
Binary bool `json:"Binary"`
// REQUIRED; 业务服务端的唯一标识。 命名规则符合正则表达式:[a-zA-Z0-9_@\-\.]{1,128}。 在一个 AppID 下,不能和真实用户用于实时消息通信的 user_ID 重复; 建议使用固定的 ID 的发送消息。
From string `json:"From"`
// REQUIRED; 点对点消息内容。如果是二进制消息,需进行 base64 编码
Message string `json:"Message"`
// REQUIRED; 房间 ID,是房间的唯一标志
RoomID string `json:"RoomId"`
// REQUIRED; 消息接收用户调用 login 接口登录时设置的 ID,可用于接收房间内消息
To string `json:"To"`
}
type SendRoomUnicastQuery ¶
type SendRoomUnicastQuery struct{}
type SendRoomUnicastReq ¶
type SendRoomUnicastReq struct {
*SendRoomUnicastQuery
*SendRoomUnicastBody
}
type SendRoomUnicastRes ¶
type SendRoomUnicastRes struct {
// REQUIRED
ResponseMetadata SendRoomUnicastResResponseMetadata `json:"ResponseMetadata"`
// REQUIRED; 仅在请求成功时返回消息 "success",表示服务端成功接收到消息,失败时为空。
Result SendRoomUnicastResResult `json:"Result"`
}
type SendRoomUnicastResResponseMetadata ¶
type SendRoomUnicastResResponseMetadata struct {
// REQUIRED
Action string `json:"Action"`
// REQUIRED
Region string `json:"Region"`
// REQUIRED
RequestID string `json:"RequestId"`
// REQUIRED
Service string `json:"Service"`
// REQUIRED
Version string `json:"Version"`
// 仅在请求失败时返回。
Error *SendRoomUnicastResResponseMetadataError `json:"Error,omitempty"`
}
type SendRoomUnicastResResponseMetadataError ¶
type SendRoomUnicastResResponseMetadataError struct {
// REQUIRED; API 的错误码
Code string `json:"Code"`
// REQUIRED; 具体的错误信息
Message string `json:"Message"`
// 网关的错误码。(请求失败时返回)
CodeN *int32 `json:"CodeN,omitempty"`
}
SendRoomUnicastResResponseMetadataError - 仅在请求失败时返回。
type SendRoomUnicastResResult ¶
type SendRoomUnicastResResult struct {
// REQUIRED; 请求成功时返回消息Success,表示服务端成功接收到消息,失败时返回具体错误信息。
Message string `json:"Message"`
}
SendRoomUnicastResResult - 仅在请求成功时返回消息 "success",表示服务端成功接收到消息,失败时为空。
type SendUnicast ¶
type SendUnicast struct{}
type SendUnicastBody ¶
type SendUnicastBody struct {
// REQUIRED; 你的音视频应用的唯一标志,参看获取 AppId [https://www.volcengine.com/docs/6348/69865#%E6%AD%A5%E9%AA%A44%EF%BC%9A%E5%88%9B%E5%BB%BA-rtc-%E5%BA%94%E7%94%A8%EF%BC%8C%E8%8E%B7%E5%8F%96-appid]。
AppID string `json:"AppId"`
// REQUIRED; * 字段为 true,发送二进制消息;
// * 字段为 false,发送文本消息。
Binary bool `json:"Binary"`
// REQUIRED; 业务服务端的唯一标识。 命名规则符合正则表达式:[a-zA-Z0-9_@\-\.]{1,128}。 在一个 AppID 下,不能和真实用户用于实时消息通信的 user_ID 重复; 建议使用固定的 ID 的发送消息。
From string `json:"From"`
// REQUIRED; 点对点消息内容。如果是二进制消息,需进行 base64 编码
Message string `json:"Message"`
// REQUIRED; 消息接收用户调用 login [70080#login] 接口登录时设置的 ID,可用于接收房间外消息
To string `json:"To"`
}
type SendUnicastQuery ¶
type SendUnicastQuery struct{}
type SendUnicastReq ¶
type SendUnicastReq struct {
*SendUnicastQuery
*SendUnicastBody
}
type SendUnicastRes ¶
type SendUnicastRes struct {
// REQUIRED
ResponseMetadata SendUnicastResResponseMetadata `json:"ResponseMetadata"`
// REQUIRED; 仅在请求成功时返回消息 "success",表示服务端成功接收到消息,失败时为空。
Result SendUnicastResResult `json:"Result"`
}
type SendUnicastResResponseMetadata ¶
type SendUnicastResResponseMetadata struct {
// REQUIRED
Action string `json:"Action"`
// REQUIRED
Region string `json:"Region"`
// REQUIRED
RequestID string `json:"RequestId"`
// REQUIRED
Service string `json:"Service"`
// REQUIRED
Version string `json:"Version"`
// 仅在请求失败时返回。
Error *SendUnicastResResponseMetadataError `json:"Error,omitempty"`
}
type SendUnicastResResponseMetadataError ¶
type SendUnicastResResponseMetadataError struct {
// REQUIRED; API 的错误码
Code string `json:"Code"`
// REQUIRED; 具体的错误信息
Message string `json:"Message"`
// 网关的错误码。(请求失败时返回)
CodeN *int32 `json:"CodeN,omitempty"`
}
SendUnicastResResponseMetadataError - 仅在请求失败时返回。
type SendUnicastResResult ¶
type SendUnicastResResult struct {
// REQUIRED; 请求成功时返回消息Success,表示服务端成功接收到消息,失败时返回具体错误信息。
Message string `json:"Message"`
}
SendUnicastResResult - 仅在请求成功时返回消息 "success",表示服务端成功接收到消息,失败时为空。
Click to show internal directories.
Click to hide internal directories.