Documentation ¶
Index ¶
Constants ¶
View Source
const ( HeaderLen = 16 ProtocolVer = 1 SequenceID = 1 )
bilibili websocket protocol
View Source
const ( OperationTypeHeart = 2 OperationTypeMessage = 5 OperationTypeEnter = 7 )
websocket operation protocol
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseAPI ¶
type BaseAPI struct {
// contains filtered or unexported fields
}
BaseAPI live info
func (*BaseAPI) GetLiveStatus ¶
GetLiveStatus get live status
func (*BaseAPI) GetPlatformName ¶
GetPlatformName return a name for live platform
type BilibiliLive ¶
type BilibiliLive struct { BaseAPI // contains filtered or unexported fields }
BilibiliLive bilibili live api
func NewBilibiliLive ¶
func NewBilibiliLive(base *BaseAPI) *BilibiliLive
NewBilibiliLive return a bilibililive struct
func (*BilibiliLive) GetDanmaku ¶
func (b *BilibiliLive) GetDanmaku(done chan struct{}) (<-chan *DanmakuMessage, error)
GetDanmaku push danmaku in chan
func (*BilibiliLive) GetStreamURLs ¶
func (b *BilibiliLive) GetStreamURLs() ([]StreamURL, error)
GetStreamURLs return live stream url map
func (*BilibiliLive) RefreshLiveInfo ¶
func (b *BilibiliLive) RefreshLiveInfo() error
RefreshLiveInfo refresh live info
type DanmakuMessage ¶
DanmakuMessage store danmaku msg
type LiveAPI ¶
type LiveAPI interface { GetLiveURL() string RefreshLiveInfo() error GetLiveStatus() bool GetPlatformName() string GetTitle() string GetAuthor() string GetLiveID() string GetStreamURLs() ([]StreamURL, error) GetDanmaku(chan struct{}) (<-chan *DanmakuMessage, error) }
LiveAPI interface
type YouTubeLive ¶
type YouTubeLive struct { BaseAPI // contains filtered or unexported fields }
YouTubeLive youtube live api
func NewYouTubeLive ¶
func NewYouTubeLive(base *BaseAPI) *YouTubeLive
NewYouTubeLive return a youtubeLive struct
func (*YouTubeLive) GetDanmaku ¶
func (y *YouTubeLive) GetDanmaku(done chan struct{}) (<-chan *DanmakuMessage, error)
GetDanmaku push danmaku in chan
func (*YouTubeLive) GetStreamURLs ¶
func (y *YouTubeLive) GetStreamURLs() ([]StreamURL, error)
GetStreamURLs return live stream url map
func (*YouTubeLive) RefreshLiveInfo ¶
func (y *YouTubeLive) RefreshLiveInfo() error
RefreshLiveInfo refresh live info
Click to show internal directories.
Click to hide internal directories.