Documentation
¶
Index ¶
- func SetServices(s *Services)
- func SetSubscribeService(s SubscribeService)
- type AttendanceOutcome
- type AttendanceService
- type BindingResolver
- type DownloaderOption
- type DownloaderStatusSource
- type IDNameOption
- type RSSWizardService
- type Services
- type SubscribeCandidate
- type SubscribeLine
- type SubscribeService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetServices ¶
func SetServices(s *Services)
func SetSubscribeService ¶
func SetSubscribeService(s SubscribeService)
SetSubscribeService 登记订阅服务(为 nil 时 /sub、/subs 回不可用)。
Types ¶
type AttendanceOutcome ¶
AttendanceOutcome 是一个站点当天的签到结果;Status 取 signed、already、failed、unsupported、pending。
type AttendanceService ¶
type AttendanceService interface {
// SignIn 立即签到一个站点。
SignIn(ctx context.Context, site string) (AttendanceOutcome, error)
// SignInAll 对开启了自动签到、当天还没有结果的站点各签到一次,返回这些站点当天的结果。
SignInAll(ctx context.Context) ([]AttendanceOutcome, error)
}
AttendanceService 是 /signin 用到的每日签到能力。
type BindingResolver ¶
type BindingResolver interface {
FindByChannelUser(ctx context.Context, confID uint, channelType, channelUserID string) (uint, bool, error)
}
BindingResolver 用于 /unbind 命令解析自身 binding ID。
type DownloaderOption ¶ added in v0.35.0
type DownloaderStatusSource ¶
type DownloaderStatusSource interface {
GetAllDownloaderStatus() []downloader.DownloaderStatus
}
DownloaderStatusSource 抽象 *downloader.DownloaderManager.GetAllDownloaderStatus()。
type IDNameOption ¶ added in v0.35.0
type RSSWizardService ¶ added in v0.35.0
type RSSWizardService interface {
AppendRSSToSite(siteName string, entry models.RSSConfig) (models.RSSConfig, error)
ListRSSForSite(siteName string) ([]models.RSSConfig, error)
DeleteRSSFromSite(siteName string, rssID uint) (models.RSSConfig, error)
ListDownloaders(ctx context.Context) ([]DownloaderOption, error)
ListFilterRules(ctx context.Context) ([]IDNameOption, error)
ListNotificationChannels(ctx context.Context) ([]IDNameOption, error)
}
type Services ¶
type Services struct {
Task app.TaskService
Torrent app.TorrentService
Site app.SiteService
Binding app.BindingService
Downloader DownloaderStatusSource
RSSWizard RSSWizardService
Bindings BindingResolver
Sessions chatops.SessionStoreAPI
Attendance AttendanceService
}
Services 是 chatops 命令访问的业务依赖集合。
type SubscribeCandidate ¶
type SubscribeCandidate struct {
Kind string `json:"kind"`
TMDBID int `json:"tmdb_id"`
Title string `json:"title"`
Year int `json:"year"`
Subscribed bool `json:"subscribed"`
}
SubscribeCandidate 是 /sub 列出的一个条目。
type SubscribeLine ¶
SubscribeLine 是 /subs 的一行。
type SubscribeService ¶
type SubscribeService interface {
// Search 在 TMDB 上按关键字找电影与剧集(按热度排)。
Search(ctx context.Context, keyword string) ([]SubscribeCandidate, error)
// Subscribe 建订阅(剧集 season 为 0 时订最新一季),返回订阅的名字(剧集带季)。
Subscribe(ctx context.Context, kind string, tmdbID, season int) (string, error)
// List 列出订阅(新的在前)。
List(ctx context.Context) ([]SubscribeLine, error)
}
SubscribeService 是 /sub、/subs 用到的订阅能力。订阅服务比 ChatOps 晚建,用 SetSubscribeService 单独登记。
Click to show internal directories.
Click to hide internal directories.