douyu

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 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 (
	PathBetard = "/betard"
)

Variables

View Source
var ShowStatus_name = map[int32]string{
	0: "Unknown",
	1: "Living",
	2: "NoLiving",
}
View Source
var ShowStatus_value = map[string]int32{
	"Unknown":  0,
	"Living":   1,
	"NoLiving": 2,
}
View Source
var VideoLoopStatus_name = map[int32]string{
	0: "Off",
	1: "On",
}
View Source
var VideoLoopStatus_value = map[string]int32{
	"Off": 0,
	"On":  1,
}

Functions

func DouyuPath

func DouyuPath(path string) string

func NewExtraKey

func NewExtraKey() *extraKey

func NewKeySet

func NewKeySet() *keySet

func ParseUid added in v0.0.10

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Avatar) Descriptor

func (*Avatar) Descriptor() ([]byte, []int)

func (*Avatar) GetBig

func (m *Avatar) GetBig() string

func (*Avatar) GetMiddle

func (m *Avatar) GetMiddle() string

func (*Avatar) GetSmall

func (m *Avatar) GetSmall() string

func (*Avatar) ProtoMessage

func (*Avatar) ProtoMessage()

func (*Avatar) Reset

func (m *Avatar) Reset()

func (*Avatar) String

func (m *Avatar) String() string

func (*Avatar) XXX_DiscardUnknown

func (m *Avatar) XXX_DiscardUnknown()

func (*Avatar) XXX_Marshal

func (m *Avatar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Avatar) XXX_Merge

func (m *Avatar) XXX_Merge(src proto.Message)

func (*Avatar) XXX_Size

func (m *Avatar) XXX_Size() int

func (*Avatar) XXX_Unmarshal

func (m *Avatar) XXX_Unmarshal(b []byte) error

type BetardResponse

type BetardResponse struct {
	Room                 *Room    `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func Betard

func Betard(id int64) (*BetardResponse, error)

func (*BetardResponse) Descriptor

func (*BetardResponse) Descriptor() ([]byte, []int)

func (*BetardResponse) GetRoom

func (m *BetardResponse) GetRoom() *Room

func (*BetardResponse) ProtoMessage

func (*BetardResponse) ProtoMessage()

func (*BetardResponse) Reset

func (m *BetardResponse) Reset()

func (*BetardResponse) String

func (m *BetardResponse) String() string

func (*BetardResponse) XXX_DiscardUnknown

func (m *BetardResponse) XXX_DiscardUnknown()

func (*BetardResponse) XXX_Marshal

func (m *BetardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BetardResponse) XXX_Merge

func (m *BetardResponse) XXX_Merge(src proto.Message)

func (*BetardResponse) XXX_Size

func (m *BetardResponse) XXX_Size() int

func (*BetardResponse) XXX_Unmarshal

func (m *BetardResponse) XXX_Unmarshal(b []byte) error

type Concern

type Concern struct {
	*StateManager
	// contains filtered or unexported fields
}

func NewConcern

func NewConcern(notify chan<- concern.Notify) *Concern

func (*Concern) Add

func (c *Concern) Add(groupCode int64, id int64, ctype concern.Type) (*LiveInfo, error)

func (Concern) CurrentLiveKey

func (l Concern) CurrentLiveKey(keys ...interface{}) string

func (*Concern) FindOrLoadRoom added in v0.0.9

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

func (*Concern) FindRoom added in v0.0.9

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

func (*Concern) ListWatching added in v0.0.8

func (c *Concern) ListWatching(groupCode int64, p concern.Type) ([]*LiveInfo, []concern.Type, error)

func (*Concern) Start

func (c *Concern) Start()

func (*Concern) Stop added in v0.0.19

func (c *Concern) Stop()

type ConcernEvent

type ConcernEvent interface {
	Type() EventType
}

type ConcernLiveNotify

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

func NewConcernLiveNotify

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

func (*ConcernLiveNotify) GetGroupCode added in v0.0.10

func (notify *ConcernLiveNotify) GetGroupCode() int64

func (*ConcernLiveNotify) GetUid added in v0.0.10

func (notify *ConcernLiveNotify) GetUid() interface{}

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() []message.IMessageElement

func (*ConcernLiveNotify) Type

func (notify *ConcernLiveNotify) Type() concern.Type

type EventType

type EventType int64
const (
	Live EventType = iota
)

type GroupConcernConfig added in v0.0.13

type GroupConcernConfig struct {
	concern_manager.GroupConcernConfig
}

func NewGroupConcernConfig added in v0.0.13

func NewGroupConcernConfig(g *concern_manager.GroupConcernConfig) *GroupConcernConfig

func (*GroupConcernConfig) AtBeforeHook added in v0.0.13

func (g *GroupConcernConfig) AtBeforeHook(notify concern.Notify) (hook *concern_manager.HookResult)

func (*GroupConcernConfig) ShouldSendHook added in v0.0.13

func (g *GroupConcernConfig) ShouldSendHook(notify concern.Notify) (hook *concern_manager.HookResult)

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"`

	LiveStatusChanged bool `json:"-"`
	LiveTitleChanged  bool `json:"-"`
}

func (*LiveInfo) GetAvatar

func (m *LiveInfo) GetAvatar() *Avatar

func (*LiveInfo) GetLiveStatusChanged added in v0.0.13

func (m *LiveInfo) GetLiveStatusChanged() bool

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

func (m *LiveInfo) GetVideoLoop() VideoLoopStatus

func (*LiveInfo) Living

func (m *LiveInfo) Living() bool

func (*LiveInfo) Logger added in v0.0.20

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

func (*LiveInfo) ToString

func (m *LiveInfo) ToString() string

func (*LiveInfo) Type

func (m *LiveInfo) Type() EventType

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"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*Room) Descriptor

func (*Room) Descriptor() ([]byte, []int)

func (*Room) GetAvatar

func (m *Room) GetAvatar() *Avatar

func (*Room) GetNickname

func (m *Room) GetNickname() string

func (*Room) GetRoomId

func (m *Room) GetRoomId() int64

func (*Room) GetRoomName

func (m *Room) GetRoomName() string

func (*Room) GetRoomUrl

func (m *Room) GetRoomUrl() string

func (*Room) GetShowStatus

func (m *Room) GetShowStatus() ShowStatus

func (*Room) GetVideoLoop

func (m *Room) GetVideoLoop() VideoLoopStatus

func (*Room) ProtoMessage

func (*Room) ProtoMessage()

func (*Room) Reset

func (m *Room) Reset()

func (*Room) String

func (m *Room) String() string

func (*Room) XXX_DiscardUnknown

func (m *Room) XXX_DiscardUnknown()

func (*Room) XXX_Marshal

func (m *Room) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Room) XXX_Merge

func (m *Room) XXX_Merge(src proto.Message)

func (*Room) XXX_Size

func (m *Room) XXX_Size() int

func (*Room) XXX_Unmarshal

func (m *Room) XXX_Unmarshal(b []byte) error

type ShowStatus

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

func (ShowStatus) EnumDescriptor

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

func (ShowStatus) String

func (x ShowStatus) String() string

type StateManager

type StateManager struct {
	*concern_manager.StateManager
	// contains filtered or unexported fields
}

func NewStateManager

func NewStateManager() *StateManager

func (*StateManager) AddLiveInfo

func (c *StateManager) AddLiveInfo(liveInfo *LiveInfo) error

func (StateManager) CurrentLiveKey

func (l StateManager) CurrentLiveKey(keys ...interface{}) string

func (*StateManager) GetLiveInfo

func (c *StateManager) GetLiveInfo(id int64) (*LiveInfo, error)

func (*StateManager) Start

func (c *StateManager) Start() error

type VideoLoopStatus

type VideoLoopStatus int32
const (
	VideoLoopStatus_Off VideoLoopStatus = 0
	VideoLoopStatus_On  VideoLoopStatus = 1
)

func (VideoLoopStatus) EnumDescriptor

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

func (VideoLoopStatus) String

func (x VideoLoopStatus) String() string

Jump to

Keyboard shortcuts

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