Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UpdateHook ¶ added in v1.5.1
type UpdateHook interface {
// PostUpdate is called after a successful update
// if error is not nil, then Updater.Rollback will be called
PostUpdate(u *Updater) error
}
UpdateHook is an interface you can implement and pass to the Updater to be called depending on the situation
type UpdateStatus ¶ added in v1.5.0
type UpdateStatus int
UpdateStatus represents the status after Updater{}.Update() was called
const ( // Unknown update status (something went wrong) Unknown UpdateStatus = iota // UpToDate means the software is already up to date UpToDate // Updated means the software have been updated Updated )
type Updater ¶
type Updater struct {
Provider provider.Provider
ExecutableName string // Name of the executable
Version string // The current version of your program
OverrideExecutable string // (optional) Overrides the path of the executable
Hook UpdateHook // (optional) Set the update hooks (see interface documentation)
// contains filtered or unexported fields
}
Updater struct
func (*Updater) GetExecutable ¶ added in v1.5.0
GetExecutable gets the executable path that will be used to for the update process same as fileio.GetExecutable() but this one takes into account the variable OverrideExecutablePath
func (*Updater) GetLatestVersion ¶ added in v1.5.0
GetLatestVersion gets the latest version (same as provider.GetLatestVersion but keeps the version in cache)
func (*Updater) Rollback ¶ added in v1.5.0
Rollback rollbacks to the previous version Use this if you know what you are doing
func (*Updater) Update ¶ added in v1.0.0
func (u *Updater) Update() (status UpdateStatus, err error)
Update runs the updater It will update the current application if an update is found