Documentation ¶
Index ¶
- Variables
- func Apply(rq *RequesParam) error
- func CommitBinary(opts *Options) error
- func Downloader(url string) (io.ReadCloser, error)
- func PrepareBinary(update io.Reader, opts *Options) error
- func Restart() error
- func RollbackError(err error) error
- type ErrRollback
- type Options
- type RequesParam
- type UpdateInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoUpdate = errors.New("no update")
Functions ¶
func Apply ¶
func Apply(rq *RequesParam) error
func CommitBinary ¶
func Downloader ¶
func Downloader(url string) (io.ReadCloser, error)
func RollbackError ¶
Types ¶
type ErrRollback ¶
type ErrRollback struct {
// contains filtered or unexported fields
}
type Options ¶
type Options struct { // TargetPath defines the path to the file to update. // The emptry string means 'the executable file of the running program'. TargetPath string // Create TargetPath replacement with this file mode. If zero, defaults to 0755. TargetMode os.FileMode // Checksum of the new binary to verify against. If nil, no checksum or signature verification is done. Checksum []byte // Use this hash function to generate the checksum. If not set, SHA256 is used. Hash crypto.Hash // 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)
Click to show internal directories.
Click to hide internal directories.