Documentation
¶
Overview ¶
Package update 提供 pixiv update 命令和自动更新检查。
包的组成:New 组装命令,RunAutomaticCheck 在命令结束后检查更新;下载、校验和替换 由 github.com/FlanChanXwO/pixiv-cli/internal/selfupdate 实现。
Index ¶
- func New(env environment.Env, loadRuntime func() (settings.RuntimeConfig, error)) *cobra.Command
- func NewAutomaticChecker(proxy string) (*selfupdate.AutomaticUpdateChecker, error)
- func NewCoordinator(proxy string, out, errOut io.Writer) (*selfupdate.UpdateCoordinator, error)
- func RunAutomaticCheck(cmd *cobra.Command, errOut io.Writer, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(env environment.Env, loadRuntime func() (settings.RuntimeConfig, error)) *cobra.Command
New 构造 update 命令;loadRuntime 提供配置中的默认代理。
func NewAutomaticChecker ¶
func NewAutomaticChecker(proxy string) (*selfupdate.AutomaticUpdateChecker, error)
NewAutomaticChecker 构造生产用 update.AutomaticUpdateChecker。
func NewCoordinator ¶
func NewCoordinator(proxy string, out, errOut io.Writer) (*selfupdate.UpdateCoordinator, error)
NewCoordinator 构造生产用 update.UpdateCoordinator。
func RunAutomaticCheck ¶
func RunAutomaticCheck(cmd *cobra.Command, errOut io.Writer, loadRuntime func() (settings.RuntimeConfig, error))
RunAutomaticCheck 在业务命令成功后展示稳定版更新提示。所有错误只写 stderr,不改变已成功命令的退出码,也不进入 stdout/MCP JSON-RPC。
Types ¶
This section is empty.