Documentation ¶
Index ¶
- Variables
- func Decode(data []byte) *dto.WSPayload
- func Encode(p *dto.WSPayload) []byte
- func RegisterHandlers(handlers ...interface{}) error
- type AnchorLotAwardHandler
- type AnchorLotCheckStatusHandler
- type AnchorLotEndHandler
- type AnchorLotStartHandler
- type Client
- type ComboSendHandler
- type CommonNoticeDanmakuHandler
- type DanmakuHandler
- type EntryEffectHandler
- type FansChangeHandler
- type GiftHandler
- type GuardHandler
- type HotRankChangedHandler
- type HotRankChangedV2Handler
- type HotRankSettlementHandler
- type HotRankSettlementV2Handler
- type InteractWordHandler
- type InteractiveGameHandler
- type LiveHandler
- type MatchRoomConfHandler
- type NoticeMsgHandler
- type OnlineRankCountHandler
- type OnlineRankTop3Handler
- type OnlineRankV2Handler
- type PopularityHandler
- type PopularityRedPocketStartHandler
- type PopularityRedPocketWinnerListHandler
- type PreparingHandler
- type RoomBlockMsgHandler
- type RoomChangeHandler
- type StopLiveRoomListHandler
- type SuperChatDeleteHandler
- type SuperChatHandler
- type TradingScoreHandler
- type UnknownEventHandler
- type UserToastMsgHandler
- type WatchedChangeHandler
- type WidgetBannerHandler
Constants ¶
This section is empty.
Variables ¶
var DefaultEventHandlers struct { Live LiveHandler Preparing PreparingHandler Danmaku DanmakuHandler Gift GiftHandler SuperChat SuperChatHandler SuperChatDelete SuperChatDeleteHandler Guard GuardHandler Popularity PopularityHandler EntryEffect EntryEffectHandler InteractWord InteractWordHandler ComboSend ComboSendHandler FansChange FansChangeHandler InteractiveGame InteractiveGameHandler OnlineRankCount OnlineRankCountHandler HotRankChanged HotRankChangedHandler HotRankChangedV2 HotRankChangedV2Handler HotRankSettlement HotRankSettlementHandler HotRankSettlementV2 HotRankSettlementV2Handler OnlineRankTop3 OnlineRankTop3Handler OnlineRankV2 OnlineRankV2Handler StopLiveRoomList StopLiveRoomListHandler WatchedChange WatchedChangeHandler WidgetBanner WidgetBannerHandler PopularityRedPocketStart PopularityRedPocketStartHandler PopularityRedPocketWinnerList PopularityRedPocketWinnerListHandler NoticeMsg NoticeMsgHandler AnchorLotAward AnchorLotAwardHandler UserToastMsg UserToastMsgHandler RoomChange RoomChangeHandler RoomBlockMsg RoomBlockMsgHandler MatchRoomConf MatchRoomConfHandler CommonNoticeDanmaku CommonNoticeDanmakuHandler AnchorLotCheckstatus AnchorLotCheckStatusHandler AnchorLotEnd AnchorLotEndHandler AnchorLotStart AnchorLotStartHandler TradingScore TradingScoreHandler // handler_struct above(for hygen) UnknownEvent UnknownEventHandler }
DefaultEventHandlers 默认事件处理器,由 RegisterHandlers 注册
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(handlers ...interface{}) error
RegisterHandlers 注册事件处理函数
Types ¶
type AnchorLotAwardHandler ¶
type AnchorLotAwardHandler func(anchorLotAward *dto.AnchorLotAward)
AnchorLotAwardHandler 天选之人中奖完整信息
type AnchorLotCheckStatusHandler ¶
type AnchorLotCheckStatusHandler func(anchorLotCheckStatus *dto.AnchorLotCheckStatus)
AnchorLotCheckStatusHandler 天选之人相关
type AnchorLotEndHandler ¶
type AnchorLotEndHandler func(anchorLotEnd *dto.AnchorLotEnd)
AnchorLotEndHandler 天选之人相关
type AnchorLotStartHandler ¶
type AnchorLotStartHandler func(anchorLotStart *dto.AnchorLotStart)
AnchorLotStartHandler 天选之人抽奖开始
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client websocket客户端实例
type CommonNoticeDanmakuHandler ¶
type CommonNoticeDanmakuHandler func(commonNoticeDanmaku *dto.CommonNoticeDanmaku)
CommonNoticeDanmakuHandler 提示信息,如'恭喜主播完成"小小花束"任务'
type EntryEffectHandler ¶
type EntryEffectHandler func(entryEffect *dto.EntryEffect)
EntryEffectHandler 进入房间特效
type FansChangeHandler ¶
type FansChangeHandler func(fansChange *dto.FansChange)
FansChangeHandler 粉丝变动
type HotRankChangedHandler ¶
type HotRankChangedHandler func(hotRankChanged *dto.HotRankChanged)
HotRankChangedHandler 热度榜单变化
type HotRankChangedV2Handler ¶
type HotRankChangedV2Handler func(hotRankChangedV2 *dto.HotRankChangedV2)
HotRankChangedV2Handler 热度榜单变化V2
type HotRankSettlementHandler ¶
type HotRankSettlementHandler func(hotRankSettlement *dto.HotRankSettlement)
HotRankSettlementHandler 热度榜单结算
type HotRankSettlementV2Handler ¶
type HotRankSettlementV2Handler func(hotRankSettlementV2 *dto.HotRankSettlementV2)
HotRankSettlementV2Handler 热度榜单结算V2
type InteractWordHandler ¶
type InteractWordHandler func(interactWord *dto.InteractWord)
InteractWordHandler 发生互动
type InteractiveGameHandler ¶
type InteractiveGameHandler func(interactiveGame *dto.InteractiveGame)
InteractiveGameHandler 游戏互动
type MatchRoomConfHandler ¶
type MatchRoomConfHandler func(matchRoomConf *dto.MatchRoomConf)
MatchRoomConfHandler 未知
type OnlineRankCountHandler ¶
type OnlineRankCountHandler func(onlineRankCount *dto.OnlineRankCount)
OnlineRankCountHandler 在线榜单
type OnlineRankTop3Handler ¶
type OnlineRankTop3Handler func(onlineRankTop3 *dto.OnlineRankTop3)
OnlineRankTop3Handler 高能榜前三
type OnlineRankV2Handler ¶
type OnlineRankV2Handler func(onlineRankV2 *dto.OnlineRankV2)
OnlineRankV2Handler 高能榜V2
type PopularityRedPocketStartHandler ¶
type PopularityRedPocketStartHandler func(popularityRedPocketStart *dto.PopularityRedPocketStart)
PopularityRedPocketStartHandler 红包开始
type PopularityRedPocketWinnerListHandler ¶
type PopularityRedPocketWinnerListHandler func(popularityRedPocketWinnerList *dto.PopularityRedPocketWinnerList)
PopularityRedPocketWinnerListHandler 红包中奖名单
type RoomBlockMsgHandler ¶
type RoomBlockMsgHandler func(roomBlockMsg *dto.RoomBlockMsg)
RoomBlockMsgHandler 房管禁言
type RoomChangeHandler ¶
type RoomChangeHandler func(roomChange *dto.RoomChange)
RoomChangeHandler 疑似房间标题变更
type StopLiveRoomListHandler ¶
type StopLiveRoomListHandler func(stopLiveRoomList *dto.StopLiveRoomList)
StopLiveRoomListHandler 停止直播列表
type SuperChatDeleteHandler ¶
type SuperChatDeleteHandler func(superChat *dto.SuperChatDelete)
SuperChatDeleteHandler 删除超级留言
type TradingScoreHandler ¶
type TradingScoreHandler func(tradingScore *dto.TradingScore)
TradingScoreHandler 未知
type UnknownEventHandler ¶
UnknownEventHandler 未知消息
type UserToastMsgHandler ¶
type UserToastMsgHandler func(userToastMsg *dto.UserToastMsg)
UserToastMsgHandler 弹幕栏中显示的toast信息,如xxx自动续费了舰长,xxx开通了舰长
type WatchedChangeHandler ¶
type WatchedChangeHandler func(watchedChange *dto.WatchedChange)
WatchedChangeHandler 观看人数变化
type WidgetBannerHandler ¶
type WidgetBannerHandler func(widgetBanner *dto.WidgetBanner)
WidgetBannerHandler 推广横幅