Documentation ¶
Index ¶
- Constants
- type AuthenInfo
- type FindLivingChargeRoomResp
- type MsgReq
- type MsgResp
- type MsgReturnKey
- type MsgReturnValueBulk
- type MsgReturnValueBulkData
- type SessionsInfo
- type SysParamByAppResp
- type UserInfo
- type UserOnlineInfo
- type UserWeekStarByAppResp
- type WsConnectInfo
- func (uwc *WsConnectInfo) HasCar() bool
- func (uwc *WsConnectInfo) IsClanAdmin() bool
- func (uwc *WsConnectInfo) IsEnterHide() bool
- func (uwc *WsConnectInfo) IsGuard() bool
- func (uwc *WsConnectInfo) IsGuardMonth() bool
- func (uwc *WsConnectInfo) IsGuardWeek() bool
- func (uwc *WsConnectInfo) IsGuardYear() bool
- func (uwc *WsConnectInfo) IsHide() bool
- func (uwc *WsConnectInfo) IsLiveAdmin() bool
- func (uwc *WsConnectInfo) IsLogin() bool
- func (uwc *WsConnectInfo) IsNobility() bool
- func (uwc *WsConnectInfo) IsNobilityLevel1() bool
- func (uwc *WsConnectInfo) IsNobilityLevel2() bool
- func (uwc *WsConnectInfo) IsNobilityLevel3() bool
- func (uwc *WsConnectInfo) IsNobilityLevel4() bool
- func (uwc *WsConnectInfo) IsNobilityLevel5() bool
- func (uwc *WsConnectInfo) IsNobilityLevel6() bool
- func (uwc *WsConnectInfo) IsNobilityLevel7() bool
- func (uwc *WsConnectInfo) IsOrdinary() bool
- func (uwc *WsConnectInfo) IsPullSide() bool
- func (uwc *WsConnectInfo) IsPushSide() bool
- func (uwc *WsConnectInfo) IsReconnect() bool
- func (uwc *WsConnectInfo) IsRoomManager() bool
- func (uwc *WsConnectInfo) IsVip() bool
Constants ¶
View Source
const ( SysParamServerName = "tl-sys-param-server" // 系统配置服务 UserServerName = "tl-user-server" // 用户服务 NobilityServerName = "tl-nobility-server" // 贵族服务 GiftServerName = "tl-gift-server" // 礼物服务 ShopServerName = "tl-shop-server" // 商店服务 LiveServerName = "tl-live-server" // 直播服务 )
View Source
const ( // 直播服务 MT_LEAVE = "leave" // 主播离开直播间 MT_DISCONNECT = "disconnect" // 主播主动断开连接 // 聊天服务 MT_CHAT = "chat" // 聊天 MT_CHAT_RECEIPT = "chatReceipt" // 聊天回执 // websocket服务 MT_ENTRY = "entry" // 进入直播间 MT_ANCHOR_ENTER = "anchorEnter" // 主播入场 // 礼物服务 MT_GIFT = "gift" // 发送礼物 MT_GIFT_TRUMPET = "giftTrumpet" // 礼物喇叭 MT_PUT_GIFT_BOX = "putGiftBox" // 投放空投宝箱 MT_GRAB_GIFT_BOX = "grabGiftBox" // 抢礼物宝箱 MT_GRAB_GIFT_BOX_NOTIFIED = "grabGiftBoxNotified" // 抢礼物宝箱结果通知 MT_GRAB_GIFT_BOX_BROAD_CAST = "grabGiftBoxBroadcast" // 抢礼物宝箱结果广播 MT_BALANCE = "balance" //余额 // 道具服务 MT_PROP_SEND = "propSend" // 发送道具 道具消息广播 // 直播服务 MT_LIVE_SETTING = "liveSetting" // 主播设置了直播间属性的通用的通知消息设置值,仅本场有效 MT_TOKEN_INVALID_NOTIFY = "tokenInvalidNotify" MT_GAMOUNT = "gamount" //礼物总金额 MT_SHIELD = "shield" //用户屏蔽 MT_BANPOST = "banPost" //用户禁言 MT_BANPOST_ALL = "banPostAll" //整个房间禁言 MT_POST_INTERVAL = "postInterval" //房间发言间隔时间设置 MT_WARN = "warn" //直播警告 MT_UNIVERSAL_BROADCAST = "universalBroadcast" //直播间通用广播消息 MT_MSG_BROADCAST = "msgBroadcast" //组件消息广播 MT_NOTIFY = "notify" //直播通知 MT_CONSUME_NOTIFY = "consumeNotify" //消费通知 MT_GENERAL_FLUTTER_SCREEN = "generalFlutterScreen" //通用飘屏消息 MT_FORBIDLIVE = "forbidLive" //禁止推流-封停 MT_LIVE_CONTROL = "liveControl" //设置场控 MT_GOOUT = "goOut" // 踢出房间 MT_BROKE_STREAM = "brokeStream" MT_PUSH_STREAM = "pushStream" MT_USER_GRADE = "userGrade" // 用户|主播等级 MT_LIVE_ADMIN_BANPOST = "liveAdminBanPost" // 超级管理员禁言 MT_NOTIFY_ONLINE_USER = "notifyOnlineUser" MT_LIVE_ADMIN_GOOUT = "liveAdminGoOut" // 超级管理员全平台踢出 MT_CACHE_SYN = "cacheSyn" // 广播里消息,通知每个节点同步缓存信息 MT_RECEIVE_ORDER_QUEUE = "receiveOrderQueue" // 调取收单方加钱待处理队列 MT_NOBILITY_TRUMPET_BROADCAST = "nobilityTrumpetBroadcast" // 贵族喇叭广播消息 MT_OPEN_NOBILITY_BROADCAST = "openNobilityBroadcast" // 贵族开通广播消息(横幅,不是消费广播) MT_TURNTABLE_STATUS_UPDATE = "turntableStatusUpdate" // 轮盘状态推送 MT_P2P_MESSAGE = "P2Pmessage" /* * 连麦PK消息类型 */ MT_LIANMAI_INVITING = "lianmaiInviting" //指定连麦邀请 MT_DECLINE_INVITING = "declineInviting" // 拒绝指定连麦邀请 MT_CANCEL_INVITING = "cancelInviting" // 取消指定连麦 MT_LIANMAI_MATCH_SUCCESS = "lianmaiMatchSuccess" // 匹配成功(包括指定连麦) MT_LIANMAI_MATCH_TIMEOUT = "lianmaiMatchTimeout" // 连麦匹配超时 MT_LIANMAI_SUCCESS = "lianmaiSuccess" // 连麦成功 MT_LIANMAI_END = "lianmaiEnd" // 连麦结束 MT_PK_START = "pkStart" // pk开始 MT_NOTIFY_FP = "notifyFP" // 通知前端火力值 MT_PK_END = "pkEnd" // pk结束 MT_FIRST_KILL = "firstKill" // 首杀通知 MT_ASSIST_KING = "assistKing" // 助攻王通知 // V06B01抽奖消息协议 MT_LIVE_DRAW_EXAMINE_RESULT = "liveDrawExamineResult" // 直播抽奖审核结果通知->通知直播间主播 MT_LIVE_DRAW_START = "liveDrawStart" // 直播抽奖开始通知->通知直播主播和观众抽奖开始 MT_LIVE_DRAW_FINISHED = "liveDrawFinished" // 直播抽奖结束通知->通知主播和观众抽奖结束 MT_USER_PRIVATE_MESSAGE = "userPrivateMessage" // 中奖通知->通知主播和中奖观众 MT_USER_PRIVATE_MESSAGE_RECEIPT = "userPrivateMessageReceipt" // 用户私信回执 )
View Source
const ( SysParamAddrSuf = "/sys/param/getSysParamListByAppId" // 系统配置服务 UserWeekStarAddrSuf = "/user/getWeekStarUsers" // 用户周星服务 PlayNobilityEnterAnimationAddrSuf = "/nobility/isPlayNobilityEnterAnimation" // 是否播放贵族动画 GiftSendSuf = "/gift/send" // 礼物发送 ScoreGiftSend = "/scoreGift/send" // 积分发送 /* * 过滤出正在直播的付费房 * 实时查询 * @param liveIds */ FindLivingChargeRoom = "/live/findLivingChargeRoom" )
View Source
const ( WEBSOCKET_PING = "ping" WEBSOCKET_PONG = "pong" )
View Source
const ( NobilityTypeNo = -1 // 未开通贵族 NobilityTypeLevel1 = 1 // 游侠 NobilityTypeLevel2 = 2 // 骑士 NobilityTypeLevel3 = 3 // 子爵 NobilityTypeLevel4 = 4 // 伯爵 NobilityTypeLevel5 = 5 // 公爵 NobilityTypeLevel6 = 6 // 国王 NobilityTypeLevel7 = 7 // 皇帝 )
NobilityType 贵族类型
View Source
const ( GuardTypeNo = "0" // 无守护 GuardTypeWeek = "1" // 无守护 GuardTypeMonth = "2" // 无守护 GuardTypeYear = "3" // 无守护 )
GuardType
View Source
const ( TokenTypeLogin = "1" // 登陆用户 TokenTypeVisitor = "2" // 游客 )
TokenType
View Source
const ( EnterTypeAnchor = "1" // 开播端 EnterTypeAudience = "2" // 观看端 )
EnterType
View Source
const ( BY_APP_ID int // 1 根据单个渠道ID广播 BY_LIVE_ID // 2 根据单个直播间ID广播 BY_SESSION_ID // 3 根据单个sessionID广播 BY_ALL // 4 向整个平台所有用户广播 BY_BULK // 5 批量消息广播 // 运营后台系统广播 BY_APP_IDS = 21 // 根据单个渠道ID, 找到其它的所有在线的直播间,向每个直播间的所有该渠道的用户广播(粒度为用户) BY_LIVE_IDS = 22 // 根据单个直播间ID广播, 给本直播间内当前渠道的所有用户广播 BY_SUB_APP_ID = 23 // 根据子渠道ID广播 )
ScopeType
View Source
const ( SUCCESS = 1 FAIL = -1 )
错误码
View Source
const ( ANCHOR = "1" // 主播 AUDIENCE = "2" // 观众 ROOM_MANAGER = "3" // 房间管理员 CLAN_ADMIN = "4" // 家族管理员 LIVE_ADMIN = "5" // 直播间超级管理员 )
Role 直播间用户角色
View Source
const (
RankLength = 10
)
View Source
const (
WEBSOCKET_PROTO_REQUEST_CONNECT_INFO = "WEBSOCKET_PROTO_REQUEST_CONNECT_INFO"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenInfo ¶
type FindLivingChargeRoomResp ¶
type FindLivingChargeRoomResp []string
type MsgReq ¶
type MsgReq struct { MessageType string `json:"messageType"` BusinessData interface{} `json:"businessData"` R string `json:"r"` T string `json:"t"` S string `json:"s"` }
client to ws
type MsgResp ¶
type MsgResp struct { MessageType string `json:"messageType"` BusinessData struct { Code int `json:"code"` // 返回数据code=1表示成功,-1表示失败 Message string `json:"message"` ResultData interface{} `json:"resultData"` } `json:"businessData"` }
ws to client
type MsgReturnKey ¶
type MsgReturnKey struct { ScopeType int `json:"scopeType"` ScopeIDList []string `json:"scopeIdList"` // 向多用户、多房间、多渠道广播,指定的ID列表,兼容单个的ID ExcludeScopeIDList []string `json:"excludeScopeIdList"` // 要排除的ID的列表,预留设计 Code int `json:"code"` // 成功或异常编码 CodeMessage string `json:"codeMessage"` // 成功固定为 SUCCESS, 失败为失败(异常)原因 MessageType string `json:"messageType"` AppIDForCurrentUser string `json:"appIdForCurrentUser"` // 当前用户所在渠道 }
kafka to ws
type MsgReturnValueBulk ¶
type MsgReturnValueBulk struct {
MsgReturnValueBulkData []MsgReturnValueBulkData
}
type MsgReturnValueBulkData ¶
type SessionsInfo ¶
type SysParamByAppResp ¶
type SysParamByAppResp struct { EnableAchievement string `json:"enableAchievement"` MsgBroadcastSwitch string `json:"msgBroadcastSwitch"` NeteaseStreamDefaultPullFormat string `json:"neteaseStreamDefaultPullFormat"` EnableCar string `json:"enableCar"` LiveManagerCountLimit string `json:"liveManagerCountLimit"` EnableTurntable string `json:"enableTurntable"` BanGroupThresholdCount string `json:"banGroupThresholdCount"` EnableGradeUpperLimit string `json:"enableGradeUpperLimit"` EnableTranslationLevel string `json:"enableTranslationLevel"` SpeakLevelFilter4Admin string `json:"speakLevelFilter4Admin"` EnableTaskBox string `json:"enableTaskBox"` EnableGiftWall string `json:"enableGiftWall"` AnchorHeartBeatTimeoutInterval string `json:"anchorHeartBeatTimeoutInterval"` NoticeUserGrade string `json:"noticeUserGrade"` LiveDefaultCoverPictureURL string `json:"liveDefaultCoverPictureUrl"` LiveInitOnlineUserListSize string `json:"liveInitOnlineUserListSize"` EntryNoticeLevelThreshold string `json:"entryNoticeLevelThreshold"` EnableGiftBox string `json:"enableGiftBox"` EnableAnchorHomepageJump string `json:"enableAnchorHomepageJump"` LiveOnlineUserListLevelFilter string `json:"liveOnlineUserListLevelFilter"` NetEaseStreamCallBackDomain string `json:"NetEaseStreamCallBackDomain"` EnableInteract string `json:"enableInteract"` EnableTranslate string `json:"enableTranslate"` FestivalDayTime string `json:"festivalDayTime"` ChatLenLimit string `json:"chatLenLimit"` NoticeDayRank string `json:"noticeDayRank"` OnlineCountSynInterval string `json:"onlineCountSynInterval"` EnableVisitorLive string `json:"enableVisitorLive"` LiveStatisticHistoryDayCount string `json:"liveStatisticHistoryDayCount"` BoomTime string `json:"boomTime"` EnableUserHomepageJump string `json:"enableUserHomepageJump"` HomepageJumpURL string `json:"homepageJumpUrl"` EnableFestival string `json:"enableFestival"` NoticeAnchorGrade string `json:"noticeAnchorGrade"` EnableProp string `json:"enableProp"` EnablePrivateMessage string `json:"enablePrivateMessage"` GradeSet10CharacterLimit string `json:"gradeSet10CharacterLimit"` ExpScore string `json:"expScore"` AudienceEnterLiveBroadcastInterval string `json:"audienceEnterLiveBroadcastInterval"` EnableLive string `json:"enableLive"` EnableOffence string `json:"enableOffence"` BoomMultiple string `json:"boomMultiple"` EnablePaster string `json:"enablePaster"` EnableNobility string `json:"enableNobility"` EnableRecordAPI string `json:"enableRecordApi"` EnableGuard string `json:"enableGuard"` EnableScore string `json:"enableScore"` EnableWeekStar string `json:"enableWeekStar"` OffenceNotifyThreshold string `json:"offenceNotifyThreshold"` GiftTrumpetPlayPeriod string `json:"giftTrumpetPlayPeriod"` GiftRatio string `json:"giftRatio"` LiveWatchCountStatisticIntervalMins string `json:"liveWatchCountStatisticIntervalMins"` SocketHeartBeatInterval string `json:"socketHeartBeatInterval"` SpeakKeyWordsBlackList string `json:"speakKeyWordsBlackList"` }
type UserInfo ¶
type UserInfo struct { AppIDForCurrentUser string AppIDForCurrentLive string SessionID string IsReconnect string UserID string OpenID string // 渠道方用户id Avatar string // 图像 UserName string Sex string Role string // 计算后的值,比如,主播,房管,是根据所进入的直播间动态确定 UserRole string // 数据库原始值 ExpGrade int // 等级 GuardType string // 守护类型 0,无;1,周守护;2,月守护;3,年守护 CarID string // 座驾id -1表示没有座驾 CarName string // 座驾名字 CarIcon string // 座驾图标 对应于 Car 类的 imgUrl CarOnlineURL string // 座驾在线地址 Car: animalUrl CarResURL string // 座驾资源下载 Car: zipUrl,现在已经废弃 IsPlayCarAnim string // 是否播放 MarkUrlsJoinString string // 动态标示 NobilityType int // 贵族类型 -1 表未开通 贵族等级1~7 IsEnterHide int // 是否入场隐身,1是,0否 TokenType string // 1 登录用户 2是游客 IsRankHide int // 是否排行榜隐身 1是 0否 ClientIP string // websocket填充 IsPlayNobilityEnterAnimation int //是否播放贵族入场动画 IsWeekStar int //是否展示周星标识 LastPingTime int64 // 最后心跳时间 LastEntryLiveTime int64 // 最后进入直播间时间 }
type UserOnlineInfo ¶
type UserOnlineInfo struct { SdkVersion string `json:"sdkVersion"` SdkType string `json:"sdkType"` AppID string `json:"appId"` LiveAppID string `json:"liveAppId"` SessionID string `json:"sessionId"` IsReconnect string `json:"isReconnect"` UserID string `json:"userId"` OpenID string `json:"openId"` Avatar string `json:"avatar"` UserName string `json:"userName"` Sex string `json:"sex"` Role string `json:"role"` // 字段是判断用户角色的,包括主播、用户、房管、超管,主要是用来对用户进行相关操作 UserRole string `json:"userRole"` // 判断当前用户是主播还是用户,主要是用来区分用户名片的,是显示主播名片还是用户名片 ExpGrade int `json:"expGrade"` GuardType string `json:"guardType"` CarID string `json:"carId"` CarName string `json:"carName"` CarIcon string `json:"carIcon"` CarOnlineURL string `json:"carOnlineUrl"` CarResURL string `json:"carResUrl"` IsPlayCarAnim string `json:"isPlayCarAnim"` MarkUrlsJoinString string `json:"markUrlsJoinString"` NobilityType int `json:"nobilityType"` IsEnterHide int `json:"isEnterHide"` TokenType string `json:"tokenType"` Reconnect bool `json:"reconnect"` Hide bool `json:"hide"` PushSide bool `json:"pushSide"` Nobility bool `json:"nobility"` Guard bool `json:"guard"` LiveID string `json:"liveId"` EnterType string `json:"enterType"` Login bool `json:"login"` PullSide bool `json:"pullSide"` RoomManager bool `json:"roomManager"` Vip bool `json:"vip"` NotHide bool `json:"notHide"` IsRankHide int `json:"isRankHide"` }
type UserWeekStarByAppResp ¶
type UserWeekStarByAppResp []string
type WsConnectInfo ¶
type WsConnectInfo struct { Sid *SessionsInfo SessionsInfoStr string Token string Authen *AuthenInfo SubAppId string // 分销渠道ID SdkVersion string // SDK版本号 SdkType string // SDK类型 1看播端 2开播端 }
func (*WsConnectInfo) HasCar ¶
func (uwc *WsConnectInfo) HasCar() bool
func (*WsConnectInfo) IsClanAdmin ¶
func (uwc *WsConnectInfo) IsClanAdmin() bool
func (*WsConnectInfo) IsEnterHide ¶
func (uwc *WsConnectInfo) IsEnterHide() bool
func (*WsConnectInfo) IsGuard ¶
func (uwc *WsConnectInfo) IsGuard() bool
func (*WsConnectInfo) IsGuardMonth ¶
func (uwc *WsConnectInfo) IsGuardMonth() bool
func (*WsConnectInfo) IsGuardWeek ¶
func (uwc *WsConnectInfo) IsGuardWeek() bool
func (*WsConnectInfo) IsGuardYear ¶
func (uwc *WsConnectInfo) IsGuardYear() bool
func (*WsConnectInfo) IsHide ¶
func (uwc *WsConnectInfo) IsHide() bool
func (*WsConnectInfo) IsLiveAdmin ¶
func (uwc *WsConnectInfo) IsLiveAdmin() bool
func (*WsConnectInfo) IsLogin ¶
func (uwc *WsConnectInfo) IsLogin() bool
func (*WsConnectInfo) IsNobility ¶
func (uwc *WsConnectInfo) IsNobility() bool
func (*WsConnectInfo) IsNobilityLevel1 ¶
func (uwc *WsConnectInfo) IsNobilityLevel1() bool
func (*WsConnectInfo) IsNobilityLevel2 ¶
func (uwc *WsConnectInfo) IsNobilityLevel2() bool
func (*WsConnectInfo) IsNobilityLevel3 ¶
func (uwc *WsConnectInfo) IsNobilityLevel3() bool
func (*WsConnectInfo) IsNobilityLevel4 ¶
func (uwc *WsConnectInfo) IsNobilityLevel4() bool
func (*WsConnectInfo) IsNobilityLevel5 ¶
func (uwc *WsConnectInfo) IsNobilityLevel5() bool
func (*WsConnectInfo) IsNobilityLevel6 ¶
func (uwc *WsConnectInfo) IsNobilityLevel6() bool
func (*WsConnectInfo) IsNobilityLevel7 ¶
func (uwc *WsConnectInfo) IsNobilityLevel7() bool
func (*WsConnectInfo) IsOrdinary ¶
func (uwc *WsConnectInfo) IsOrdinary() bool
func (*WsConnectInfo) IsPullSide ¶
func (uwc *WsConnectInfo) IsPullSide() bool
func (*WsConnectInfo) IsPushSide ¶
func (uwc *WsConnectInfo) IsPushSide() bool
func (*WsConnectInfo) IsReconnect ¶
func (uwc *WsConnectInfo) IsReconnect() bool
func (*WsConnectInfo) IsRoomManager ¶
func (uwc *WsConnectInfo) IsRoomManager() bool
func (*WsConnectInfo) IsVip ¶
func (uwc *WsConnectInfo) IsVip() bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.