douyu

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

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 DouyuPath

func DouyuPath(path string) string

func NewExtraKey

func NewExtraKey() *extraKey

func NewKeySet

func NewKeySet() *keySet

func ParseUid

func ParseUid(s string) (int64, error)

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) Descriptor() ([]byte, []int)

Deprecated: Use Avatar.ProtoReflect.Descriptor instead.

func (*Avatar) GetBig

func (x *Avatar) GetBig() string

func (*Avatar) GetMiddle

func (x *Avatar) GetMiddle() string

func (*Avatar) GetSmall

func (x *Avatar) GetSmall() string

func (*Avatar) ProtoMessage

func (*Avatar) ProtoMessage()

func (*Avatar) ProtoReflect

func (x *Avatar) ProtoReflect() protoreflect.Message

func (*Avatar) Reset

func (x *Avatar) Reset()

func (*Avatar) String

func (x *Avatar) String() string

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

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 NewConcern(notify chan<- concern.Notify) *Concern

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

func (c *Concern) FindOrLoadRoom(roomId int64) (*LiveInfo, error)

func (*Concern) FindRoom

func (c *Concern) FindRoom(id int64, load bool) (*LiveInfo, error)

func (*Concern) Get

func (c *Concern) Get(id interface{}) (concern.IdentityInfo, error)

func (*Concern) GetStateManager

func (c *Concern) GetStateManager() concern.IStateManager

func (*Concern) ParseId

func (c *Concern) ParseId(s string) (interface{}, error)

func (*Concern) Remove

func (c *Concern) Remove(ctx mmsg.IMsgCtx, groupCode int64, _id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)

func (*Concern) Site

func (c *Concern) Site() string

func (*Concern) Start

func (c *Concern) Start() error

func (*Concern) Stop

func (c *Concern) Stop()

func (*Concern) Types

func (c *Concern) Types() []concern_type.Type

type ConcernLiveNotify

type ConcernLiveNotify struct {
	*LiveInfo
	GroupCode int64 `json:"group_code"`
}

func NewConcernLiveNotify

func NewConcernLiveNotify(groupCode int64, l *LiveInfo) *ConcernLiveNotify

func (*ConcernLiveNotify) GetGroupCode

func (notify *ConcernLiveNotify) GetGroupCode() int64

func (*ConcernLiveNotify) Logger

func (notify *ConcernLiveNotify) Logger() *logrus.Entry

func (*ConcernLiveNotify) ToMessage

func (notify *ConcernLiveNotify) ToMessage() (m *mmsg.MSG)

type GroupConcernConfig

type GroupConcernConfig struct {
	concern.IConfig
}

func NewGroupConcernConfig

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) GetAvatar

func (m *LiveInfo) GetAvatar() *Avatar

func (*LiveInfo) GetLiveStatusChanged

func (m *LiveInfo) GetLiveStatusChanged() bool

func (*LiveInfo) GetMSG

func (m *LiveInfo) GetMSG() *mmsg.MSG

func (*LiveInfo) GetName

func (m *LiveInfo) GetName() string

func (*LiveInfo) GetNickname

func (m *LiveInfo) GetNickname() string

func (*LiveInfo) GetRoomId

func (m *LiveInfo) GetRoomId() int64

func (*LiveInfo) GetRoomName

func (m *LiveInfo) GetRoomName() string

func (*LiveInfo) GetRoomUrl

func (m *LiveInfo) GetRoomUrl() string

func (*LiveInfo) GetShowStatus

func (m *LiveInfo) GetShowStatus() ShowStatus

func (*LiveInfo) GetUid

func (m *LiveInfo) GetUid() interface{}

func (*LiveInfo) GetVideoLoop

func (m *LiveInfo) GetVideoLoop() VideoLoopStatus

func (*LiveInfo) IsLive

func (m *LiveInfo) IsLive() bool

func (*LiveInfo) LiveStatusChanged

func (m *LiveInfo) LiveStatusChanged() bool

func (*LiveInfo) Living

func (m *LiveInfo) Living() bool

func (*LiveInfo) Logger

func (m *LiveInfo) Logger() *logrus.Entry

func (*LiveInfo) Site

func (m *LiveInfo) Site() string

func (*LiveInfo) TitleChanged

func (m *LiveInfo) TitleChanged() bool

func (*LiveInfo) ToString

func (m *LiveInfo) ToString() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Room.ProtoReflect.Descriptor instead.

func (*Room) GetAvatar

func (x *Room) GetAvatar() *Avatar

func (*Room) GetNickname

func (x *Room) GetNickname() string

func (*Room) GetRoomId

func (x *Room) GetRoomId() int64

func (*Room) GetRoomName

func (x *Room) GetRoomName() string

func (*Room) GetRoomUrl

func (x *Room) GetRoomUrl() string

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

func (x *Room) ProtoReflect() protoreflect.Message

func (*Room) Reset

func (x *Room) Reset()

func (*Room) String

func (x *Room) String() string

type ShowStatus

type ShowStatus int32
const (
	ShowStatus_Unknown  ShowStatus = 0
	ShowStatus_Living   ShowStatus = 1
	ShowStatus_NoLiving ShowStatus = 2
)

func (ShowStatus) Descriptor

func (ShowStatus) Descriptor() protoreflect.EnumDescriptor

func (ShowStatus) Enum

func (x ShowStatus) Enum() *ShowStatus

func (ShowStatus) EnumDescriptor deprecated

func (ShowStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use ShowStatus.Descriptor instead.

func (ShowStatus) Number

func (x ShowStatus) Number() protoreflect.EnumNumber

func (ShowStatus) String

func (x ShowStatus) String() string

func (ShowStatus) Type

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

func (c *StateManager) DeleteLiveInfo(id int64) error

func (*StateManager) GetGroupConcernConfig

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

func (VideoLoopStatus) Enum

func (x VideoLoopStatus) Enum() *VideoLoopStatus

func (VideoLoopStatus) EnumDescriptor deprecated

func (VideoLoopStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use VideoLoopStatus.Descriptor instead.

func (VideoLoopStatus) Number

func (VideoLoopStatus) String

func (x VideoLoopStatus) String() string

func (VideoLoopStatus) Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL