Documentation ¶
Index ¶
- Constants
- Variables
- func HuyaPath(path string) string
- func NewExtraKey() *extraKey
- func NewKeySet() *keySet
- type Concern
- func (c *Concern) Add(ctx mmsg.IMsgCtx, groupCode int64, id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)
- func (k Concern) CurrentLiveKey(keys ...interface{}) string
- func (c *Concern) FindOrLoadRoom(roomId string) (*LiveInfo, error)
- func (c *Concern) FindRoom(roomId string, 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) GetMSG() *mmsg.MSG
- func (m *LiveInfo) GetName() string
- func (m *LiveInfo) GetUid() interface{}
- 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 StateManager
- func (c *StateManager) AddLiveInfo(liveInfo *LiveInfo) error
- func (k StateManager) CurrentLiveKey(keys ...interface{}) string
- func (c *StateManager) DeleteLiveInfo(id string) error
- func (c *StateManager) GetGroupConcernConfig(groupCode int64, id interface{}) (concernConfig concern.IConfig)
- func (c *StateManager) GetLiveInfo(id string) (*LiveInfo, error)
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 NewExtraKey ¶
func NewExtraKey() *extraKey
Types ¶
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 (k 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 { 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 (*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 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)
Click to show internal directories.
Click to hide internal directories.