huya

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Site = "huya"
	Host = "https://www.huya.com"
)
View Source
const (
	Live concern_type.Type = "live"
)

Variables

View Source
var (
	ErrRoomNotExist = errors.New("房间不存在")
	ErrRoomBanned   = errors.New("涉嫌违规,正在整改中")
)

Functions

func HuyaPath

func HuyaPath(path string) string

func NewExtraKey

func NewExtraKey() *extraKey

func NewKeySet

func NewKeySet() *keySet

Types

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 (k Concern) CurrentLiveKey(keys ...interface{}) string

func (*Concern) FindOrLoadRoom added in v0.0.9

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

func (*Concern) FindRoom added in v0.0.9

func (c *Concern) FindRoom(roomId string, load bool) (*LiveInfo, error)

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) ParseId added in v1.0.0

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

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) Site added in v1.0.0

func (c *Concern) Site() string

func (*Concern) Start

func (c *Concern) Start() error

func (*Concern) Stop added in v0.0.19

func (c *Concern) Stop()

func (*Concern) Types added in v1.0.0

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

type GroupConcernConfig struct {
	concern.IConfig
}

func NewGroupConcernConfig added in v0.0.13

func NewGroupConcernConfig(g concern.IConfig) *GroupConcernConfig

type LiveInfo

type LiveInfo struct {
	RoomId   string `json:"room_id"`
	RoomUrl  string `json:"room_url"`
	Avatar   string `json:"avatar"`
	Name     string `json:"name"`
	RoomName string `json:"room_name"`
	IsLiving bool   `json:"living"`
	// contains filtered or unexported fields
}

func RoomPage

func RoomPage(roomId string) (*LiveInfo, error)

func (*LiveInfo) GetMSG added in v1.0.1

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

func (*LiveInfo) GetName added in v0.0.13

func (m *LiveInfo) GetName() string

func (*LiveInfo) GetUid added in v1.0.0

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

func (*LiveInfo) IsLive added in v1.0.0

func (m *LiveInfo) IsLive() bool

func (*LiveInfo) LiveStatusChanged added in v0.0.13

func (m *LiveInfo) LiveStatusChanged() bool

func (*LiveInfo) Living

func (m *LiveInfo) Living() bool

func (*LiveInfo) Logger added in v0.0.20

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

func (*LiveInfo) Site added in v1.0.0

func (m *LiveInfo) Site() string

func (*LiveInfo) TitleChanged added in v1.0.0

func (m *LiveInfo) TitleChanged() bool

func (*LiveInfo) ToString

func (m *LiveInfo) ToString() string

func (*LiveInfo) Type

func (m *LiveInfo) Type() concern_type.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 (k StateManager) CurrentLiveKey(keys ...interface{}) string

func (*StateManager) DeleteLiveInfo added in v1.0.2

func (c *StateManager) DeleteLiveInfo(id string) 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 string) (*LiveInfo, error)

Jump to

Keyboard shortcuts

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