Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Plat() string
// GetPlayURL qn传入 conf.QnBest conf.QnHigh conf.QnMid conf.QnLow
GetPlayURL(room string, qn int) (*PlayURL, error)
// GetRoomInfo room可以为短号也可以为长号
GetRoomInfo(room string) (*RoomInfo, error)
// Host ws host,对于部分需要用到room的直播平台会传入room,其他平台忽略即可
Host(room string) string
// Enter 一次可以返回多条消息,hub将按顺序依次发送,用于需要一次发送多条进入直播间消息的场景
Enter(room string) (tp int, data [][]byte, err error)
// Handle matched为是否读取msg的操作,用于跳过不想匹配的消息,err为错误,先判断错误再判断matched
Handle(tp int, data []byte) (msg []Msg, matched bool, err error)
HeartBeat() (tp int, data []byte, err error)
// SendDanmaku tp 1:top 0:right 2:bottom color:十进制颜色值
SendDanmaku(room string, content string, tp int, color int64) error
// Stop 释放内部资源
Stop()
}
Client live platform client interface
type Favorite ¶
type Favorite struct {
ID uint64 `gorm:"primaryKey;column:id;index" json:"id"` // ID
FID uint64 `gorm:"not null;column:fid;index" json:"fid"` // 收藏夹ID
Order int `gorm:"not null;column:order" json:"order"` // 排序
Plat string `gorm:"not null;column:plat" json:"plat"` // 平台
Room string `gorm:"not null;column:room" json:"room"` // 房间名
Upper string `gorm:"not null;column:upper" json:"upper"` // 主播名
TimeHook
}
Favorite fav for live room
type FavoritesList ¶
type FavoritesList struct {
ID uint64 `gorm:"primaryKey;column:id;index" json:"id"`
Title string `gorm:"not null;unique;column:title" json:"title"`
Order int `gorm:"not null;column:order" json:"order"`
TimeHook
}
FavoritesList fav list
type MsgDanmaku ¶
type MsgDanmaku struct {
Content string `json:"content"`
Type int `json:"type"`
Color int64 `json:"color"`
}
func (*MsgDanmaku) Event ¶
func (m *MsgDanmaku) Event() string
type OSInfo ¶
type OSInfo struct {
Uptime uint64 `json:"uptime"`
OS string `json:"os"`
Platform string `json:"platform"`
PlatformVersion string `json:"platform_version"`
KernelVersion string `json:"kernel_version"`
KernelArch string `json:"kernel_arch"`
}
OSInfo os info
type PlayURL ¶
type PlayURL struct {
Qn int `json:"qn"`
Desc string `json:"desc"`
Origin string `json:"origin"`
CORS bool `json:"cors"`
Type string `json:"type"`
}
PlayURL live stream info
type RoomInfo ¶
type RoomInfo struct {
Status int `json:"status"` // 0:未开播 1:已开播
Room string `json:"room"` // 真实房间号
Upper string `json:"upper"` // 主播名称
Link string `json:"link"` // 直播间地址
Title string `json:"title"` // 直播间标题
}
RoomInfo live room info
type SysMem ¶
type SysMem struct {
Total uint64 `json:"total"`
TotalStr string `json:"total_str"`
Avl uint64 `json:"avl"`
AvlStr string `json:"avl_str"`
}
SysMem system memory info
Click to show internal directories.
Click to hide internal directories.