Documentation ¶
Index ¶
- Constants
- Variables
- func NewExtraKey() *extraKey
- func VideoViewUrl(videoId string) string
- type Concern
- func (c *Concern) Add(ctx mmsg.IMsgCtx, groupCode int64, _id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)
- func (c *Concern) FindInfo(channelId string, load bool) (*Info, error)
- func (c *Concern) FindOrLoad(channelId string) (*Info, error)
- func (c *Concern) Get(id interface{}) (concern.IdentityInfo, error)
- func (c *Concern) GetStateManager() concern.IStateManager
- func (e Concern) InfoKey(keys ...interface{}) string
- 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
- func (e Concern) UserInfoKey(keys ...interface{}) string
- func (e Concern) VideoKey(keys ...interface{}) string
- type ConcernNotify
- type GroupConcernConfig
- type Info
- type KeySet
- func (k *KeySet) FreshKey(keys ...interface{}) string
- func (k *KeySet) GroupAtAllMarkKey(keys ...interface{}) string
- func (k *KeySet) GroupConcernConfigKey(keys ...interface{}) string
- func (k *KeySet) GroupConcernStateKey(keys ...interface{}) string
- func (k *KeySet) ParseGroupConcernStateKey(key string) (int64, interface{}, error)
- type Searcher
- type StateManager
- func (s *StateManager) AddInfo(info *Info) error
- func (s *StateManager) AddVideo(v *VideoInfo) error
- func (s *StateManager) GetGroupConcernConfig(groupCode int64, id interface{}) (concernConfig concern.IConfig)
- func (s *StateManager) GetInfo(channelId string) (*Info, error)
- func (s *StateManager) GetVideo(channelId string, videoId string) (*VideoInfo, error)
- func (e StateManager) InfoKey(keys ...interface{}) string
- func (e StateManager) UserInfoKey(keys ...interface{}) string
- func (e StateManager) VideoKey(keys ...interface{}) string
- type UserInfo
- type VideoInfo
- func (v *VideoInfo) GetMSG() *mmsg.MSG
- func (v *VideoInfo) GetUid() interface{}
- func (v *VideoInfo) IsLive() bool
- func (v *VideoInfo) IsLiving() bool
- func (v *VideoInfo) IsVideo() bool
- func (v *VideoInfo) IsWaiting() bool
- func (v *VideoInfo) LiveStatusChanged() bool
- func (v *VideoInfo) Living() bool
- func (v *VideoInfo) Logger() *logrus.Entry
- func (v *VideoInfo) Site() string
- func (v *VideoInfo) TitleChanged() bool
- func (v *VideoInfo) Type() concern_type.Type
- type VideoStatus
- func (VideoStatus) Descriptor() protoreflect.EnumDescriptor
- func (x VideoStatus) Enum() *VideoStatus
- func (VideoStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x VideoStatus) Number() protoreflect.EnumNumber
- func (x VideoStatus) String() string
- func (VideoStatus) Type() protoreflect.EnumType
- type VideoType
Constants ¶
View Source
const ( Video concern_type.Type = "news" Live concern_type.Type = "live" )
View Source
const Site = "youtube"
View Source
const VideoPath = "https://www.youtube.com/channel/%s/videos?view=57&flow=grid"
View Source
const VideoView = "https://www.youtube.com/watch?v="
Variables ¶
View Source
var ( VideoStatus_name = map[int32]string{ 0: "Waiting", 1: "Living", 2: "Upload", } VideoStatus_value = map[string]int32{ "Waiting": 0, "Living": 1, "Upload": 2, } )
Enum value maps for VideoStatus.
View Source
var ( VideoType_name = map[int32]string{ 0: "FirstLive", 1: "Live", 2: "Video", } VideoType_value = map[string]int32{ "FirstLive": 0, "Live": 1, "Video": 2, } )
Enum value maps for VideoType.
View Source
var File_lsp_youtube_youtube_proto protoreflect.FileDescriptor
Functions ¶
func NewExtraKey ¶
func NewExtraKey() *extraKey
func VideoViewUrl ¶
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) FindOrLoad ¶ 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
func (Concern) UserInfoKey ¶
func (e Concern) UserInfoKey(keys ...interface{}) string
type ConcernNotify ¶
func NewConcernNotify ¶
func NewConcernNotify(groupCode int64, info *VideoInfo) *ConcernNotify
func (*ConcernNotify) GetGroupCode ¶ added in v0.0.10
func (notify *ConcernNotify) GetGroupCode() int64
func (*ConcernNotify) Logger ¶ added in v0.0.17
func (notify *ConcernNotify) Logger() *logrus.Entry
func (*ConcernNotify) ToMessage ¶ added in v0.0.10
func (notify *ConcernNotify) ToMessage() (m *mmsg.MSG)
type GroupConcernConfig ¶ added in v0.0.13
func NewGroupConcernConfig ¶ added in v0.0.13
func NewGroupConcernConfig(g concern.IConfig) *GroupConcernConfig
func (*GroupConcernConfig) ShouldSendHook ¶ added in v0.0.13
func (g *GroupConcernConfig) ShouldSendHook(notify concern.Notify) *concern.HookResult
type KeySet ¶
type KeySet struct { }
func (*KeySet) GroupAtAllMarkKey ¶ added in v0.0.10
func (*KeySet) GroupConcernConfigKey ¶ added in v0.0.10
func (*KeySet) GroupConcernStateKey ¶
type Searcher ¶
type Searcher struct { Sub []*gabs.Container // contains filtered or unexported fields }
type StateManager ¶
type StateManager struct { *concern.StateManager // contains filtered or unexported fields }
func NewStateManager ¶
func NewStateManager(notify chan<- concern.Notify) *StateManager
func (*StateManager) AddInfo ¶
func (s *StateManager) AddInfo(info *Info) error
func (*StateManager) AddVideo ¶
func (s *StateManager) AddVideo(v *VideoInfo) error
func (*StateManager) GetGroupConcernConfig ¶ added in v1.0.0
func (s *StateManager) GetGroupConcernConfig(groupCode int64, id interface{}) (concernConfig concern.IConfig)
func (*StateManager) GetVideo ¶
func (s *StateManager) GetVideo(channelId string, videoId string) (*VideoInfo, error)
func (StateManager) UserInfoKey ¶
func (e StateManager) UserInfoKey(keys ...interface{}) string
type UserInfo ¶
type UserInfo struct { ChannelId string `json:"channel_id"` ChannelName string `json:"channel_name"` }
func NewUserInfo ¶ added in v0.0.7
func (*UserInfo) GetChannelName ¶ added in v0.0.13
type VideoInfo ¶
type VideoInfo struct { UserInfo Cover string `json:"cover"` VideoId string `json:"video_id"` VideoTitle string `json:"video_title"` VideoType VideoType `json:"video_type"` VideoStatus VideoStatus `json:"video_status"` VideoTimestamp int64 `json:"video_timestamp"` // contains filtered or unexported fields }
VideoInfo may be a video or a live, depend on the VideoType
func (*VideoInfo) LiveStatusChanged ¶ added in v0.0.13
func (*VideoInfo) TitleChanged ¶ added in v1.0.0
func (*VideoInfo) Type ¶
func (v *VideoInfo) Type() concern_type.Type
type VideoStatus ¶
type VideoStatus int32
const ( VideoStatus_Waiting VideoStatus = 0 VideoStatus_Living VideoStatus = 1 VideoStatus_Upload VideoStatus = 2 )
func (VideoStatus) Descriptor ¶ added in v1.1.1
func (VideoStatus) Descriptor() protoreflect.EnumDescriptor
func (VideoStatus) Enum ¶ added in v1.1.1
func (x VideoStatus) Enum() *VideoStatus
func (VideoStatus) EnumDescriptor
deprecated
func (VideoStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use VideoStatus.Descriptor instead.
func (VideoStatus) Number ¶ added in v1.1.1
func (x VideoStatus) Number() protoreflect.EnumNumber
func (VideoStatus) String ¶
func (x VideoStatus) String() string
func (VideoStatus) Type ¶ added in v1.1.1
func (VideoStatus) Type() protoreflect.EnumType
type VideoType ¶
type VideoType int32
func (VideoType) Descriptor ¶ added in v1.1.1
func (VideoType) Descriptor() protoreflect.EnumDescriptor
func (VideoType) EnumDescriptor
deprecated
func (VideoType) Number ¶ added in v1.1.1
func (x VideoType) Number() protoreflect.EnumNumber
func (VideoType) Type ¶ added in v1.1.1
func (VideoType) Type() protoreflect.EnumType
Click to show internal directories.
Click to hide internal directories.