Documentation
¶
Index ¶
Constants ¶
View Source
const ( WS_OP_HEARTBEAT int32 = 2 WS_OP_HEARTBEAT_REPLY int32 = 3 WS_OP_MESSAGE int32 = 5 WS_OP_USER_AUTHENTICATION int32 = 7 WS_OP_CONNECT_SUCCESS int32 = 8 WS_PACKAGE_HEADER_TOTAL_LENGTH int32 = 16 //WS_PACKAGE_OFFSET int32 = 0 //WS_HEADER_OFFSET int32 = 4 //WS_VERSION_OFFSET int32 = 6 //WS_OPERATION_OFFSET int32 = 8 //WS_SEQUENCE_OFFSET int32 = 12 //WS_BODY_PROTOCOL_VERSION_NORMAL int32 = 0 WS_BODY_PROTOCOL_VERSION_DEFLATE int16 = 2 WS_HEADER_DEFAULT_VERSION int16 = 1 //WS_HEADER_DEFAULT_OPERATION int32 = 1 WS_HEADER_DEFAULT_SEQUENCE int32 = 1 WS_AUTH_OK int32 = 0 WS_AUTH_TOKEN_ERROR int32 = -101 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComboEndModel ¶
type ComboEndModel struct {
GiftName string `json:"gift_name"` // 礼物名称
ComboNum int `json:"combo_num"` // 连击数量
UserName string `json:"uname"` // 用户名称
GiftID int `json:"gift_id"` // 礼物ID
Price int `json:"price"` // 价格
GuardLevel int `json:"guard_level"` // 舰长等级
StartTime int64 `json:"start_time"` // 开始时间
EndTime int64 `json:"end_time"` // 结束时间
}
ComboEndModel 连击结束模型
type ComboSendModel ¶
type ComboSendModel struct {
UserName string `json:"uname"` // 用户名称
GiftName string `json:"gift_name"` // 礼物名称
GiftID int `json:"gift_id"` // 礼物ID
ComboNum int `json:"combo_num"` // 连击数量
}
ComboSendModel 连击模型
type FansUpdateModel ¶
type FansUpdateModel struct {
RoomID int `json:"roomid"`
Fans int `json:"fans"`
RedNotice int `json:"red_notice"`
}
FansUpdateModel 粉丝更新模型
type GiftModel ¶
type GiftModel struct {
GiftName string `json:"giftName"` // 礼物名称
Num int `json:"num"` // 数量
UserName string `json:"uname"` // 用户名称
UserID int64 `json:"uid"` // 用户ID
GiftID int `json:"giftId"` // 礼物ID
Price int `json:"price"` // 价格
CoinType string `json:"coin_type"` // 硬币类型
FaceURL string `json:"face"` // 头像url
Combo int `json:"super_gift_num"` // 连击
Timestamp int64 `json:"timestamp"` // 时间
}
GiftModel 礼物模型
type GuardBuyModel ¶
type GuardBuyModel struct {
GiftName string `json:"gift_name"` // 礼物名称
Num int `json:"num"` // 数量
UserID int64 `json:"uid"` // 用户ID
UserName string `json:"username"` // 用户名称
GiftID int `json:"gift_id"` // 礼物ID
Price int `json:"price"` // 价格
GuardLevel int `json:"guard_level"` // 舰长等级
}
GuardBuyModel 上船模型
type GuardEnterModel ¶
type GuardEnterModel struct {
UserID int64 `json:"uid"`
UserName string `json:"username"`
GuardLevel int `json:"guard_level"`
}
GuardEnterModel 舰长进入模型
type Live ¶
type Live struct {
Debug bool // 是否显示日志
AnalysisRoutineNum int // 消息分析协程数量,默认为1,为1可以保证通知顺序与接收到消息顺序相同
StormFilter bool // 过滤节奏风暴弹幕,默认false不过滤
Live func(int) // 直播开始通知
End func(int) // 直播结束通知
ReceiveMsg func(int, *MsgModel) // 接收消息方法
ReceiveGift func(int, *GiftModel) // 接收礼物方法
ReceivePopularValue func(int, uint32) // 接收人气值方法
UserEnter func(int, *UserEnterModel) // 用户进入方法
GuardEnter func(int, *GuardEnterModel) // 舰长进入方法
GiftComboSend func(int, *ComboSendModel) // 礼物连击方法
GiftComboEnd func(int, *ComboEndModel) // 礼物连击结束方法
GuardBuy func(int, *GuardBuyModel) // 上船
FansUpdate func(int, *FansUpdateModel) // 粉丝数更新
RoomRank func(int, *RankModel) // 小时榜
RoomChange func(int, *RoomChangeModel) // 房间信息变更
SpecialGift func(int, *SpecialGiftModel) // 特殊礼物
SuperChatMessage func(int, *SuperChatMessageModel) // 超级留言
SysMessage func(int, *SysMsgModel) // 系统信息
// contains filtered or unexported fields
}
Live 直播间
type MsgModel ¶
type MsgModel struct {
UserID int64 // 用户ID
UserName string // 用户昵称
UserLevel int // 用户等级
MedalName string // 勋章名
MedalUpName string // 勋章主播名称
MedalRoomID int64 // 勋章直播间ID
MedalLevel int // 勋章等级
Content string // 内容
Timestamp int64 // 时间
}
MsgModel 消息
type RankModel ¶
type RankModel struct {
RoomID int `json:"roomid"`
RankDesc string `json:"rank_desc"`
Timestamp int64 `json:"timestamp"`
}
RankModel 小时榜模型
type RoomChangeModel ¶
type RoomChangeModel struct {
Title string `json:"title"`
AreaID int `json:"area_id"`
ParentAreaID int `json:"parent_area_id"`
AreaName string `json:"area_name"`
ParentAreaName string `json:"parent_area_name"`
}
RoomChangeModel 房间基础信息变更
type SpecialGiftModel ¶
type SpecialGiftModel struct {
Storm struct {
ID int64 `json:"-"`
TempID interface{} `json:"id"` // 因为b站通知节奏风暴开始和结束id类型不同,用这个变量作为中转
Action string `json:"action"`
Content string `json:"content"`
Num int `json:"num"`
Time int `json:"time"`
} `json:"39"`
}
SpecialGiftModel 特殊礼物模型
type SuperChatMessageModel ¶
type SuperChatMessageModel struct {
Price int `json:"price"`
Message string `json:"message"`
UserInfo struct {
UserName string `json:"uname"`
} `json:"user_info"`
}
SuperChatMessageModel 超级留言模型
type SysMsgModel ¶
type SysMsgModel struct {
Cmd string `json:"cmd"`
Msg string `json:"msg"`
MsgText string `json:"msg_text"`
}
SysMsgModel 系统信息
Click to show internal directories.
Click to hide internal directories.