Documentation ¶
Index ¶
- Constants
- Variables
- func NewExtraKey() *extraKey
- func VideoViewUrl(videoId string) string
- type Concern
- func (c *Concern) Add(groupCode int64, id string, ctype concern.Type) (info *Info, err error)
- func (c *Concern) FindInfo(channelId string, load bool) (*Info, error)
- func (c *Concern) FindOrLoad(channelId string) (*Info, error)
- func (e Concern) InfoKey(keys ...interface{}) string
- func (c *Concern) ListWatching(groupCode int64, ctype concern.Type) ([]*UserInfo, []concern.Type, error)
- func (c *Concern) Start()
- func (e Concern) UserInfoKey(keys ...interface{}) string
- func (e Concern) VideoKey(keys ...interface{}) string
- type ConcernEvent
- type ConcernNotify
- type EventType
- 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) GetInfo(channelId string) (info *Info, err error)
- func (s *StateManager) GetVideo(channelId string, videoId string) (*VideoInfo, error)
- func (e StateManager) InfoKey(keys ...interface{}) string
- func (s *StateManager) Start() error
- func (e StateManager) UserInfoKey(keys ...interface{}) string
- func (e StateManager) VideoKey(keys ...interface{}) string
- type UserInfo
- type VideoInfo
- type VideoStatus
- type VideoType
Constants ¶
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",
}
View Source
var VideoStatus_value = map[string]int32{
"Waiting": 0,
"Living": 1,
"Upload": 2,
}
View Source
var VideoType_name = map[int32]string{
0: "FirstLive",
1: "Live",
2: "Video",
}
View Source
var VideoType_value = map[string]int32{
"FirstLive": 0,
"Live": 1,
"Video": 2,
}
Functions ¶
func NewExtraKey ¶
func NewExtraKey() *extraKey
func VideoViewUrl ¶
Types ¶
type Concern ¶
type Concern struct { *StateManager // contains filtered or unexported fields }
func NewConcern ¶
func (*Concern) FindOrLoad ¶ added in v0.0.9
func (*Concern) ListWatching ¶ added in v0.0.7
func (Concern) UserInfoKey ¶
func (e Concern) UserInfoKey(keys ...interface{}) string
type ConcernEvent ¶
type ConcernEvent interface {
Type() EventType
}
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) GetUid ¶ added in v0.0.10
func (notify *ConcernNotify) GetUid() interface{}
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() []message.IMessageElement
func (*ConcernNotify) Type ¶
func (notify *ConcernNotify) Type() concern.Type
type GroupConcernConfig ¶ added in v0.0.13
type GroupConcernConfig struct {
concern_manager.GroupConcernConfig
}
func NewGroupConcernConfig ¶ added in v0.0.13
func NewGroupConcernConfig(g *concern_manager.GroupConcernConfig) *GroupConcernConfig
func (*GroupConcernConfig) AtBeforeHook ¶ added in v0.0.13
func (g *GroupConcernConfig) AtBeforeHook(notify concern.Notify) (hook *concern_manager.HookResult)
func (*GroupConcernConfig) ShouldSendHook ¶ added in v0.0.13
func (g *GroupConcernConfig) ShouldSendHook(notify concern.Notify) (hook *concern_manager.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 StateManager ¶
type StateManager struct { *concern_manager.StateManager // contains filtered or unexported fields }
func NewStateManager ¶
func NewStateManager() *StateManager
func (*StateManager) AddInfo ¶
func (s *StateManager) AddInfo(info *Info) error
func (*StateManager) AddVideo ¶
func (s *StateManager) AddVideo(v *VideoInfo) error
func (*StateManager) GetInfo ¶
func (s *StateManager) GetInfo(channelId string) (info *Info, err error)
func (*StateManager) GetVideo ¶
func (s *StateManager) GetVideo(channelId string, videoId string) (*VideoInfo, error)
func (*StateManager) Start ¶
func (s *StateManager) Start() 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"` LiveStatusChanged bool `json:"-"` }
VideoInfo may be a video or a live, depend on the VideoType
type VideoStatus ¶
type VideoStatus int32
const ( VideoStatus_Waiting VideoStatus = 0 VideoStatus_Living VideoStatus = 1 VideoStatus_Upload VideoStatus = 2 )
func (VideoStatus) EnumDescriptor ¶
func (VideoStatus) EnumDescriptor() ([]byte, []int)
func (VideoStatus) String ¶
func (x VideoStatus) String() string
Click to show internal directories.
Click to hide internal directories.