update

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package update 注册 update 命令;更新实现仍归 internal/update。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAutomaticChecker

func NewAutomaticChecker(proxy string) (*updateapp.AutomaticUpdateChecker, error)

NewAutomaticChecker 构造生产用 update.AutomaticUpdateChecker。

func NewCommand

func NewCommand(host Host) *cobra.Command

NewCommand 只负责将 update 命令注册到同目录实现。

func NewCoordinator

func NewCoordinator(proxy string, out, errOut io.Writer) (*updateapp.UpdateCoordinator, error)

NewCoordinator 构造生产用 update.UpdateCoordinator。

func Register

func Register(root *cobra.Command, host Host)

func RunAutomaticCheck

func RunAutomaticCheck(cmd *cobra.Command, host AutomaticCheckHost)

RunAutomaticCheck 在业务命令成功后展示稳定版更新提示。所有错误只写 stderr,不改变已成功命令的退出码,也不进入 stdout/MCP JSON-RPC。

Types

type AutomaticCheckHost

type AutomaticCheckHost interface {
	ErrorOutput() io.Writer
	LoadAutomaticUpdateRuntimeConfig() (configapp.RuntimeConfig, error)
	NewAutomaticUpdateChecker(string) (*updateapp.AutomaticUpdateChecker, error)
}

AutomaticCheckHost 是成功命令后的只读更新检查所需的最小依赖端口。

type Host

type Host interface {
	Output() io.Writer
	ErrorOutput() io.Writer
	PrintJSON(any) error
	RequireExactArgs(int, string) cobra.PositionalArgs
	LoadUpdateRuntimeConfig() (configapp.RuntimeConfig, error)
	NewUpdateCoordinator(string, io.Writer, io.Writer) (*updateapp.UpdateCoordinator, error)
}

Jump to

Keyboard shortcuts

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