Documentation ¶
Index ¶
- Variables
- type GroupConcernConfig
- type LastStatus
- type LiveEvent
- type LiveNotify
- type LiveStatus
- type TwitCastConcern
- func (tc *TwitCastConcern) Add(ctx mmsg.IMsgCtx, groupCode int64, id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)
- func (tc *TwitCastConcern) Get(id interface{}) (concern.IdentityInfo, error)
- func (tc TwitCastConcern) GetGroupConcernConfig(groupCode int64, id interface{}) concern.IConfig
- func (tc *TwitCastConcern) GetIsLive(user string) (*LiveStatus, error)
- func (tc *TwitCastConcern) GetStateManager() concern.IStateManager
- func (tc *TwitCastConcern) ParseId(s string) (interface{}, error)
- func (tc *TwitCastConcern) Remove(ctx mmsg.IMsgCtx, groupCode int64, id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)
- func (tc *TwitCastConcern) Site() string
- func (tc *TwitCastConcern) Start() error
- func (tc *TwitCastConcern) Stop()
- func (tc *TwitCastConcern) Types() []concern_type.Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Site = "twitcasting" Live concern_type.Type = "live" )
Functions ¶
This section is empty.
Types ¶
type GroupConcernConfig ¶
func NewGroupConcernConfig ¶
func NewGroupConcernConfig(g concern.IConfig) *GroupConcernConfig
func (*GroupConcernConfig) ShouldSendHook ¶
func (g *GroupConcernConfig) ShouldSendHook(notify concern.Notify) *concern.HookResult
type LastStatus ¶
type LiveEvent ¶
type LiveEvent struct { Id string Live bool Name string Movie *cas.MovieContainer }
func (*LiveEvent) Type ¶
func (e *LiveEvent) Type() concern_type.Type
type LiveNotify ¶
type LiveNotify struct { LiveEvent // contains filtered or unexported fields }
func (*LiveNotify) GetGroupCode ¶
func (n *LiveNotify) GetGroupCode() int64
func (*LiveNotify) Logger ¶
func (n *LiveNotify) Logger() *logrus.Entry
func (*LiveNotify) ToMessage ¶
func (n *LiveNotify) ToMessage() *mmsg.MSG
type LiveStatus ¶ added in v1.0.3
type LiveStatus struct { UserId string Living bool Movie *cas.MovieContainer }
type TwitCastConcern ¶
type TwitCastConcern struct {
// contains filtered or unexported fields
}
func NewConcern ¶
func NewConcern(notify chan<- concern.Notify) *TwitCastConcern
NewConcern 返回一个新的 TwitCastConcern, 推荐像这样将 notify channel 通过参数传进来,方便编写单元测试 此处使用的 concern.NewStateManagerWithStringID 适用于 string 类型的id 如果 ParseId 中选择了int64类型, 则此处可以选择 concern.NewStateManagerWithInt64ID
func (*TwitCastConcern) Add ¶
func (tc *TwitCastConcern) Add(ctx mmsg.IMsgCtx, groupCode int64, id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)
func (*TwitCastConcern) Get ¶
func (tc *TwitCastConcern) Get(id interface{}) (concern.IdentityInfo, error)
Get 实现查询单个订阅的信息
func (TwitCastConcern) GetGroupConcernConfig ¶
func (*TwitCastConcern) GetIsLive ¶ added in v1.0.3
func (tc *TwitCastConcern) GetIsLive(user string) (*LiveStatus, error)
func (*TwitCastConcern) GetStateManager ¶
func (tc *TwitCastConcern) GetStateManager() concern.IStateManager
GetStateManager 返回我们自定义修改过的 concern.IStateManager,让所有修改对框架生效
func (*TwitCastConcern) ParseId ¶
func (tc *TwitCastConcern) ParseId(s string) (interface{}, error)
func (*TwitCastConcern) Remove ¶
func (tc *TwitCastConcern) Remove(ctx mmsg.IMsgCtx, groupCode int64, id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)
Remove 实现删除一个订阅
func (*TwitCastConcern) Site ¶
func (tc *TwitCastConcern) Site() string
func (*TwitCastConcern) Start ¶
func (tc *TwitCastConcern) Start() error
func (*TwitCastConcern) Stop ¶
func (tc *TwitCastConcern) Stop()
func (*TwitCastConcern) Types ¶
func (tc *TwitCastConcern) Types() []concern_type.Type
Click to show internal directories.
Click to hide internal directories.