twitcasting

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Site                   = "twitcasting"
	Live concern_type.Type = "live"
)

Functions

This section is empty.

Types

type GroupConcernConfig

type GroupConcernConfig struct {
	concern.IConfig
}

func NewGroupConcernConfig

func NewGroupConcernConfig(g concern.IConfig) *GroupConcernConfig

func (*GroupConcernConfig) ShouldSendHook

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

type LastStatus

type LastStatus struct {
	Live      bool
	LastMovie int
}

type LiveEvent

type LiveEvent struct {
	Id    string
	Live  bool
	Name  string
	Movie *cas.MovieContainer
}

func (*LiveEvent) GetUid

func (e *LiveEvent) GetUid() interface{}

func (*LiveEvent) Logger

func (e *LiveEvent) Logger() *logrus.Entry

func (*LiveEvent) Site

func (e *LiveEvent) Site() string

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 (tc TwitCastConcern) GetGroupConcernConfig(groupCode int64, id interface{}) concern.IConfig

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

Jump to

Keyboard shortcuts

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