Documentation ¶
Overview ¶
This file implements the background WebSocket messaging channel in Bilibili webui. Server send livestream start and stop messages via this channel. Note: In this file we manage the concrete WebSocket connection. The Bilibili WebSocket channel protocol is decoupled and implemented in package `dmpkg`.
Index ¶
Constants ¶
View Source
const BilibiliWebSocketMessageType = websocket.MessageBinary
BilibiliWebSocketMessageType Bilibili uses only binary WebSocket messages
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DanmakuClient ¶
type DanmakuClient struct {
// contains filtered or unexported fields
}
func NewClient ¶ added in v0.5.0
func NewClient(ctx context.Context, ws *websocket.Conn) DanmakuClient
func (*DanmakuClient) Authenticate ¶
func (d *DanmakuClient) Authenticate(roomId types.RoomId, authKey, buvid3 string) error
func (*DanmakuClient) Disconnect ¶
func (d *DanmakuClient) Disconnect() error
func (*DanmakuClient) Heartbeat ¶
func (d *DanmakuClient) Heartbeat() error
func (*DanmakuClient) ReadExchange ¶
func (d *DanmakuClient) ReadExchange() (dmpkg.DanmakuExchange, error)
ReadExchange read and decode some kind of exchanges which we are interested
type DanmakuMessageType ¶
type DanmakuMessageType int
Click to show internal directories.
Click to hide internal directories.