Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoUpdate = errors.New("no update")
Functions ¶
func Apply ¶
func Apply(rq *RequesParam) error
Types ¶
type ErrRollback ¶
type ErrRollback struct {
Rollback error // error encountered while rolling back
// contains filtered or unexported fields
}
type RequesParam ¶
type UpdateInfo ¶
type UpdateInfo struct {
Type string `note:"更新方式"`
Error string `note:"错误信息"`
Message string `note:"提示信息"`
Release string `note:"更新说明"`
Version string `note:"最新版本"`
Package string `note:"下载地址"`
}
func CheckVersion ¶
func CheckVersion(rq *RequesParam) (*UpdateInfo, error)
type Updater ¶ added in v0.3.2
type Updater struct {
// 要更新的文件的路径。默认为 '正在运行的文件'
TargetPath string
// 可执行文件的权限掩码。默认为 0755
TargetMode os.FileMode
// 要应用的新二进制文件的路径。此参数不能为空
NewBinary string
// 新二进制文件的SHA256校验和。默认不进行校验
Checksum []byte
}
func (*Updater) CommitBinary ¶ added in v0.3.2
func (*Updater) VerifyChecksum ¶ added in v0.3.5
Click to show internal directories.
Click to hide internal directories.