增加分布式更新方法

This commit is contained in:
2025-10-27 19:07:48 +08:00
parent 10c349b82f
commit c48c85f075
15 changed files with 345 additions and 112 deletions

View File

@@ -0,0 +1,36 @@
// ================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// You can delete these comments if you wish manually maintain this interface file.
// ================================================================================
package service
import (
"context"
)
type (
ISystem interface {
Init()
Update(ctx context.Context) (err error)
// RestartSelf 实现 Windows 平台下的程序自重启
RestartSelf() error
// RenameRunningFile 重命名正在运行的程序文件(如 p2p.exe → p2p.exe~
RenameRunningFile(exePath string) (string, error)
}
)
var (
localSystem ISystem
)
func System() ISystem {
if localSystem == nil {
panic("implement not found for interface ISystem, forgot register?")
}
return localSystem
}
func RegisterSystem(i ISystem) {
localSystem = i
}