Documentation ¶
Index ¶
- Constants
- Variables
- func DouyuPath(path string) string
- func NewExtraKey() *extraKey
- func NewKeySet() *keySet
- func ParseUid(s string) (int64, error)
- type Avatar
- type BetardResponse
- type Concern
- func (c *Concern) Add(ctx mmsg.IMsgCtx, groupCode int64, _id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)
- func (l Concern) CurrentLiveKey(keys ...interface{}) string
- func (c *Concern) FindOrLoadRoom(roomId int64) (*LiveInfo, error)
- func (c *Concern) FindRoom(id int64, load bool) (*LiveInfo, error)
- func (c *Concern) Get(id interface{}) (concern.IdentityInfo, error)
- func (c *Concern) GetStateManager() concern.IStateManager
- func (c *Concern) ParseId(s string) (interface{}, error)
- func (c *Concern) Remove(ctx mmsg.IMsgCtx, groupCode int64, _id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)
- func (c *Concern) Site() string
- func (c *Concern) Start() error
- func (c *Concern) Stop()
- func (c *Concern) Types() []concern_type.Type
- type ConcernLiveNotify
- type GroupConcernConfig
- type LiveInfo
- func (m *LiveInfo) GetAvatar() *Avatar
- func (m *LiveInfo) GetLiveStatusChanged() bool
- func (m *LiveInfo) GetMSG() *mmsg.MSG
- func (m *LiveInfo) GetName() string
- func (m *LiveInfo) GetNickname() string
- func (m *LiveInfo) GetRoomId() int64
- func (m *LiveInfo) GetRoomName() string
- func (m *LiveInfo) GetRoomUrl() string
- func (m *LiveInfo) GetShowStatus() ShowStatus
- func (m *LiveInfo) GetUid() interface{}
- func (m *LiveInfo) GetVideoLoop() VideoLoopStatus
- func (m *LiveInfo) IsLive() bool
- func (m *LiveInfo) LiveStatusChanged() bool
- func (m *LiveInfo) Living() bool
- func (m *LiveInfo) Logger() *logrus.Entry
- func (m *LiveInfo) Site() string
- func (m *LiveInfo) TitleChanged() bool
- func (m *LiveInfo) ToString() string
- func (m *LiveInfo) Type() concern_type.Type
- type Room
- func (*Room) Descriptor() ([]byte, []int)deprecated
- func (x *Room) GetAvatar() *Avatar
- func (x *Room) GetNickname() string
- func (x *Room) GetRoomId() int64
- func (x *Room) GetRoomName() string
- func (x *Room) GetRoomUrl() string
- func (x *Room) GetShowStatus() ShowStatus
- func (x *Room) GetVideoLoop() VideoLoopStatus
- func (*Room) ProtoMessage()
- func (x *Room) ProtoReflect() protoreflect.Message
- func (x *Room) Reset()
- func (x *Room) String() string
- type ShowStatus
- type StateManager
- func (c *StateManager) AddLiveInfo(liveInfo *LiveInfo) error
- func (l StateManager) CurrentLiveKey(keys ...interface{}) string
- func (c *StateManager) DeleteLiveInfo(id int64) error
- func (c *StateManager) GetGroupConcernConfig(groupCode int64, id interface{}) (concernConfig concern.IConfig)
- func (c *StateManager) GetLiveInfo(id int64) (*LiveInfo, error)
- type VideoLoopStatus
- func (VideoLoopStatus) Descriptor() protoreflect.EnumDescriptor
- func (x VideoLoopStatus) Enum() *VideoLoopStatus
- func (VideoLoopStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x VideoLoopStatus) Number() protoreflect.EnumNumber
- func (x VideoLoopStatus) String() string
- func (VideoLoopStatus) Type() protoreflect.EnumType
Constants ¶
View Source
const ( Site = "douyu" Host = "https://www.douyu.com" )
View Source
const (
Live concern_type.Type = "live"
)
View Source
const (
PathBetard = "/betard"
)
Variables ¶
View Source
var ( ShowStatus_name = map[int32]string{ 0: "Unknown", 1: "Living", 2: "NoLiving", } ShowStatus_value = map[string]int32{ "Unknown": 0, "Living": 1, "NoLiving": 2, } )
Enum value maps for ShowStatus.
View Source
var ( VideoLoopStatus_name = map[int32]string{ 0: "Off", 1: "On", } VideoLoopStatus_value = map[string]int32{ "Off": 0, "On": 1, } )
Enum value maps for VideoLoopStatus.
View Source
var ( ErrRoomNotExist = errors.New("房间不存在") ErrRoomBanned = errors.New("房间已被关闭") )
View Source
var File_lsp_douyu_douyu_proto protoreflect.FileDescriptor
Functions ¶
func NewExtraKey ¶
func NewExtraKey() *extraKey
Types ¶
type Avatar ¶
type Avatar struct { Big string `protobuf:"bytes,1,opt,name=big,proto3" json:"big,omitempty"` Middle string `protobuf:"bytes,2,opt,name=middle,proto3" json:"middle,omitempty"` Small string `protobuf:"bytes,3,opt,name=small,proto3" json:"small,omitempty"` // contains filtered or unexported fields }
func (*Avatar) Descriptor
deprecated
func (*Avatar) ProtoMessage ¶
func (*Avatar) ProtoMessage()
func (*Avatar) ProtoReflect ¶ added in v1.1.1
func (x *Avatar) ProtoReflect() protoreflect.Message
type BetardResponse ¶
type BetardResponse struct { Room *Room `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"` // contains filtered or unexported fields }
func Betard ¶
func Betard(id int64) (*BetardResponse, error)
func (*BetardResponse) Descriptor
deprecated
func (*BetardResponse) Descriptor() ([]byte, []int)
Deprecated: Use BetardResponse.ProtoReflect.Descriptor instead.
func (*BetardResponse) GetRoom ¶
func (x *BetardResponse) GetRoom() *Room
func (*BetardResponse) ProtoMessage ¶
func (*BetardResponse) ProtoMessage()
func (*BetardResponse) ProtoReflect ¶ added in v1.1.1
func (x *BetardResponse) ProtoReflect() protoreflect.Message
func (*BetardResponse) Reset ¶
func (x *BetardResponse) Reset()
func (*BetardResponse) String ¶
func (x *BetardResponse) String() string
type Concern ¶
type Concern struct {
*StateManager
}
func NewConcern ¶
func (*Concern) Add ¶
func (c *Concern) Add(ctx mmsg.IMsgCtx, groupCode int64, _id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)
func (Concern) CurrentLiveKey ¶
func (l Concern) CurrentLiveKey(keys ...interface{}) string
func (*Concern) FindOrLoadRoom ¶ added in v0.0.9
func (*Concern) Get ¶ added in v1.0.0
func (c *Concern) Get(id interface{}) (concern.IdentityInfo, error)
func (*Concern) GetStateManager ¶ added in v1.0.0
func (c *Concern) GetStateManager() concern.IStateManager
func (*Concern) Remove ¶ added in v1.0.0
func (c *Concern) Remove(ctx mmsg.IMsgCtx, groupCode int64, _id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)
func (*Concern) Types ¶ added in v1.0.0
func (c *Concern) Types() []concern_type.Type
type ConcernLiveNotify ¶
func NewConcernLiveNotify ¶
func NewConcernLiveNotify(groupCode int64, l *LiveInfo) *ConcernLiveNotify
func (*ConcernLiveNotify) GetGroupCode ¶ added in v0.0.10
func (notify *ConcernLiveNotify) GetGroupCode() int64
func (*ConcernLiveNotify) Logger ¶ added in v0.0.17
func (notify *ConcernLiveNotify) Logger() *logrus.Entry
func (*ConcernLiveNotify) ToMessage ¶ added in v0.0.10
func (notify *ConcernLiveNotify) ToMessage() (m *mmsg.MSG)
type GroupConcernConfig ¶ added in v0.0.13
func NewGroupConcernConfig ¶ added in v0.0.13
func NewGroupConcernConfig(g concern.IConfig) *GroupConcernConfig
type LiveInfo ¶
type LiveInfo struct { Nickname string `json:"nickname"` RoomId int64 `json:"room_id"` RoomName string `json:"room_name"` RoomUrl string `json:"room_url"` ShowStatus ShowStatus `json:"show_status"` VideoLoop VideoLoopStatus `json:"videoLoop"` Avatar *Avatar `json:"avatar"` // contains filtered or unexported fields }
func (*LiveInfo) GetLiveStatusChanged ¶ added in v0.0.13
func (*LiveInfo) GetNickname ¶
func (*LiveInfo) GetRoomName ¶
func (*LiveInfo) GetRoomUrl ¶
func (*LiveInfo) GetShowStatus ¶
func (m *LiveInfo) GetShowStatus() ShowStatus
func (*LiveInfo) GetVideoLoop ¶
func (m *LiveInfo) GetVideoLoop() VideoLoopStatus
func (*LiveInfo) LiveStatusChanged ¶ added in v0.0.13
func (*LiveInfo) TitleChanged ¶ added in v1.0.0
func (*LiveInfo) Type ¶
func (m *LiveInfo) Type() concern_type.Type
type Room ¶
type Room struct { Nickname string `protobuf:"bytes,1,opt,name=nickname,proto3" json:"nickname,omitempty"` RoomId int64 `protobuf:"varint,2,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"` RoomName string `protobuf:"bytes,3,opt,name=room_name,json=roomName,proto3" json:"room_name,omitempty"` RoomUrl string `protobuf:"bytes,4,opt,name=room_url,json=roomUrl,proto3" json:"room_url,omitempty"` ShowStatus ShowStatus `protobuf:"varint,5,opt,name=show_status,json=showStatus,proto3,enum=douyu.ShowStatus" json:"show_status,omitempty"` VideoLoop VideoLoopStatus `protobuf:"varint,6,opt,name=videoLoop,proto3,enum=douyu.VideoLoopStatus" json:"videoLoop,omitempty"` Avatar *Avatar `protobuf:"bytes,7,opt,name=avatar,proto3" json:"avatar,omitempty"` // contains filtered or unexported fields }
func (*Room) Descriptor
deprecated
func (*Room) GetNickname ¶
func (*Room) GetRoomName ¶
func (*Room) GetRoomUrl ¶
func (*Room) GetShowStatus ¶
func (x *Room) GetShowStatus() ShowStatus
func (*Room) GetVideoLoop ¶
func (x *Room) GetVideoLoop() VideoLoopStatus
func (*Room) ProtoMessage ¶
func (*Room) ProtoMessage()
func (*Room) ProtoReflect ¶ added in v1.1.1
func (x *Room) ProtoReflect() protoreflect.Message
type ShowStatus ¶
type ShowStatus int32
const ( ShowStatus_Unknown ShowStatus = 0 ShowStatus_Living ShowStatus = 1 ShowStatus_NoLiving ShowStatus = 2 )
func (ShowStatus) Descriptor ¶ added in v1.1.1
func (ShowStatus) Descriptor() protoreflect.EnumDescriptor
func (ShowStatus) Enum ¶ added in v1.1.1
func (x ShowStatus) Enum() *ShowStatus
func (ShowStatus) EnumDescriptor
deprecated
func (ShowStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use ShowStatus.Descriptor instead.
func (ShowStatus) Number ¶ added in v1.1.1
func (x ShowStatus) Number() protoreflect.EnumNumber
func (ShowStatus) String ¶
func (x ShowStatus) String() string
func (ShowStatus) Type ¶ added in v1.1.1
func (ShowStatus) Type() protoreflect.EnumType
type StateManager ¶
type StateManager struct { *concern.StateManager // contains filtered or unexported fields }
func NewStateManager ¶
func NewStateManager(notify chan<- concern.Notify) *StateManager
func (*StateManager) AddLiveInfo ¶
func (c *StateManager) AddLiveInfo(liveInfo *LiveInfo) error
func (StateManager) CurrentLiveKey ¶
func (l StateManager) CurrentLiveKey(keys ...interface{}) string
func (*StateManager) DeleteLiveInfo ¶ added in v1.0.2
func (c *StateManager) DeleteLiveInfo(id int64) error
func (*StateManager) GetGroupConcernConfig ¶ added in v1.0.0
func (c *StateManager) GetGroupConcernConfig(groupCode int64, id interface{}) (concernConfig concern.IConfig)
func (*StateManager) GetLiveInfo ¶
func (c *StateManager) GetLiveInfo(id int64) (*LiveInfo, error)
type VideoLoopStatus ¶
type VideoLoopStatus int32
const ( VideoLoopStatus_Off VideoLoopStatus = 0 VideoLoopStatus_On VideoLoopStatus = 1 )
func (VideoLoopStatus) Descriptor ¶ added in v1.1.1
func (VideoLoopStatus) Descriptor() protoreflect.EnumDescriptor
func (VideoLoopStatus) Enum ¶ added in v1.1.1
func (x VideoLoopStatus) Enum() *VideoLoopStatus
func (VideoLoopStatus) EnumDescriptor
deprecated
func (VideoLoopStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use VideoLoopStatus.Descriptor instead.
func (VideoLoopStatus) Number ¶ added in v1.1.1
func (x VideoLoopStatus) Number() protoreflect.EnumNumber
func (VideoLoopStatus) String ¶
func (x VideoLoopStatus) String() string
func (VideoLoopStatus) Type ¶ added in v1.1.1
func (VideoLoopStatus) Type() protoreflect.EnumType
Click to show internal directories.
Click to hide internal directories.