cli

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() (string, error)

ConfigPath 返回配置文件路径。

func InstallOrSwitch

func InstallOrSwitch(targetVersion string) error

InstallOrSwitch 从 GitHub Release 安装或切换 CLI 版本。

func PrintConfig

func PrintConfig() error

PrintConfig 打印当前配置。

func PrintVersion

func PrintVersion()

PrintVersion 打印当前版本。

func RunDiff

func RunDiff(serverURL, project, from, to, serverID, token string) error

RunDiff 对比两版本在 server_id 下的配置差异。

func RunDoctor

func RunDoctor(serverURL, token, project, serverID string) error

RunDoctor 检查中央服务、token、server_id 配置是否可用。

func RunListServers

func RunListServers(serverURL, token string) error

RunListServers 列出中央 server.yaml 中配置的 server_id。

func RunListVersions

func RunListVersions(serverURL, project, token string) error

RunListVersions 列出项目已发布版本。

func RunPreview

func RunPreview(serverURL, project, version, serverID, token string) error

RunPreview 预览 server_id 在某版本下的配置变更(使用拉取 token)。

func RunPull

func RunPull(opts PullOptions) error

RunPull 从中央服务拉取并解压,可选执行后处理脚本。

func RunPullBatch

func RunPullBatch(opts PullOptions, listPath string) error

RunPullBatch 按清单批量拉取:每行 server_id[,dest_dir]。

func RunRollback

func RunRollback(opts PullOptions, toVersion string, stepsBack int) error

RunRollback 部署上一已发布版本(或 --to 指定版本)。

func SaveUserConfig

func SaveUserConfig(c UserConfig) error

SaveUserConfig 写入用户配置。

Types

type PullOptions

type PullOptions struct {
	ServerURL string
	Project   string
	ServerID  string
	Token     string
	Version   string
	DestDir   string
	OS        string
	Arch      string
	Tags      []string
	SkipHook  bool
}

PullOptions 拉取参数。

func MergePullOptions

func MergePullOptions(opts PullOptions) PullOptions

MergePullOptions 用配置文件填充 CLI 未指定的字段。

type UserConfig

type UserConfig struct {
	Server  string `yaml:"server"`
	Token   string `yaml:"token"`
	Project string `yaml:"project"`
	Dest    string `yaml:"default_dest"`
}

UserConfig ~/.express233/config.yaml

func LoadUserConfig

func LoadUserConfig() (UserConfig, error)

LoadUserConfig 读取用户配置(不存在则空配置)。

Jump to

Keyboard shortcuts

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