commands

package
v1.0.0-rc.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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

type AttendanceOutcome struct {
	Site    string
	Status  string
	Message string
	Error   string
}

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 DownloaderOption struct {
	ID        uint
	Name      string
	IsDefault bool
}

type DownloaderStatusSource

type DownloaderStatusSource interface {
	GetAllDownloaderStatus() []downloader.DownloaderStatus
}

DownloaderStatusSource 抽象 *downloader.DownloaderManager.GetAllDownloaderStatus()。

type IDNameOption added in v0.35.0

type IDNameOption struct {
	ID   uint
	Name string
}

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

type SubscribeLine struct {
	Title    string
	Status   string
	Progress string
}

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 单独登记。

Jump to

Keyboard shortcuts

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