Documentation ¶
Index ¶
- Variables
- func ByteArrToDecimal(src []byte) (sum int)
- func GetRealRoomID(short int) (realID uint32, err error)
- func GetToken(roomid uint32) (key string)
- func ZlibInflate(compress []byte) ([]byte, error)
- type CMD
- type Client
- type DanMuMsg
- type Gift
- type Notice
- type Pool
- type RequestInfo
- type RoomInfo
- type WelCome
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RealID = "http://api.live.bilibili.com/room/v1/Room/room_init" // params: id=xxx DanMuServer = "ks-live-dmcmt-bj6-pm-02.chat.bilibili.com:443" )
Functions ¶
func GetRealRoomID ¶
func ZlibInflate ¶
Types ¶
type Client ¶
type Client struct { Room RoomInfo `json:"room"` Request *RequestInfo `json:"request"` Connected bool `json:"connected"` // contains filtered or unexported fields }
Client instance
func (*Client) ReceiveMsg ¶
func (*Client) SendPackage ¶
type DanMuMsg ¶
type DanMuMsg struct { UID uint32 `json:"uid"` Uname string `json:"uname"` Ulevel uint32 `json:"ulevel"` Text string `json:"text"` MedalLevel uint32 `json:"medal_level"` MedalName string `json:"medal_name"` MedalId uint32 `json:"medal_uid"` }
func (*DanMuMsg) GetDanmuMsg ¶
type Gift ¶
type Gift struct { UUname string `json:"u_uname"` Action string `json:"action"` Num uint32 `json:"num"` Price uint32 `json:"price"` GiftName string `json:"gift_name"` }
func (*Gift) GetGiftMsg ¶
type Pool ¶
type Pool struct { UserMsg chan string UserGift chan string UserEnter chan string UserGuard chan string MsgUncompressed chan string UserEntry chan string }
Pool`s fields map CMD value
type RequestInfo ¶
type RequestInfo struct { Uid uint8 `json:"uid"` Roomid uint32 `json:"roomid"` Protover uint8 `json:"protover"` Platform string `json:"platform"` Clientver string `json:"clientver"` Type uint8 `json:"type"` Key string `json:"key"` }
data on handshake packets
func NewRequestInfo ¶
func NewRequestInfo(roomid uint32) *RequestInfo
NewRequestInfo return initialized structure
type RoomInfo ¶
type RoomInfo struct { RoomId uint32 `json:"room_id"` UpUid uint32 `json:"up_uid"` Title string `json:"title"` Online uint32 `json:"online"` Tags string `json:"tags"` LiveStatus bool `json:"live_status"` LockStatus bool `json:"lock_status"` }
Basic information of the live room
func GetRoomInfo ¶
Click to show internal directories.
Click to hide internal directories.