Skip to content

Commit 86d280b

Browse files
committed
feat(updater): 添加自动更新功能支持
实现通过 GitHub Release 检查更新和自动下载更新功能 添加 check-update 和 update 命令用于检查和应用更新 支持版本校验、文件完整性验证和自动重启
1 parent 825748f commit 86d280b

File tree

3 files changed

+620
-0
lines changed

3 files changed

+620
-0
lines changed

internal/config/config.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var (
2020
type Configuration struct {
2121
Server ServerConfig `yaml:"server"`
2222
SSL SSLConfig `yaml:"ssl"`
23+
Update UpdateConfig `yaml:"update"`
2324
}
2425

2526
type (
@@ -31,6 +32,15 @@ type (
3132
SSLConfig struct {
3233
Path string `yaml:"path"`
3334
}
35+
36+
UpdateConfig struct {
37+
// 镜像源类型: github(默认), ghproxy, fastgit, custom
38+
Mirror string `yaml:"mirror"`
39+
// 自定义镜像地址(当 mirror=custom 时使用)
40+
CustomURL string `yaml:"customUrl"`
41+
// HTTP 代理地址
42+
Proxy string `yaml:"proxy"`
43+
}
3444
)
3545

3646
// Init 初始化配置

0 commit comments

Comments
 (0)