upgrade

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoUpdate = errors.New("no update")

Functions

func Apply

func Apply(rq *RequesParam) error

func Restart

func Restart() error

Types

type ErrRollback

type ErrRollback struct {
	Rollback error // error encountered while rolling back
	// contains filtered or unexported fields
}

type RequesParam

type RequesParam struct {
	Server  string `note:"更新服务器"`
	Version string `note:"当前版本"`
}

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 (u *Updater) CommitBinary() error

func (*Updater) Init added in v0.3.5

func (u *Updater) Init() error

func (*Updater) VerifyChecksum added in v0.3.5

func (u *Updater) VerifyChecksum() error

Jump to

Keyboard shortcuts

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