selfupdate

package module
v0.0.0-...-3bc6d24 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 17 Imported by: 5

README

selfupdate

The package allows to add the ability for monitoring and installing new version to your apps

Currently only MSI packages are supported.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(newCfg Config) error

func DownloadAndInstallUpdate

func DownloadAndInstallUpdate(u *UpdateInfo) error

func SetLogger

func SetLogger(l *logrus.Logger)

Types

type Config

type Config struct {
	AppName                 string
	CurrentVersion          string
	CheckInterval           time.Duration
	UpdatesFeedURL          string
	HTTPTimeout             time.Duration
	DownloadTimeout         time.Duration
	ShutdownCallbackTimeout time.Duration
	// RequestShutdownCallback this function will be called when update will be ready to install
	// if error is returned, no update will be performed
	RequestShutdownCallback func() error
	// SigningCertificatedName is used to check for package and Feed URL webhost certificate
	// if empty, no certificate check performed
	SigningCertificatedName string
}

func DefaultConfig

func DefaultConfig() Config

func (Config) Validate

func (c Config) Validate() error

type UpdateInfo

type UpdateInfo struct {
	Version     *version.Version
	DownloadURL string
	Checksum    string
}

func ListAvailableUpdates

func ListAvailableUpdates() ([]*UpdateInfo, error)

type Updater

type Updater struct {
	// contains filtered or unexported fields
}

func StartChecking

func StartChecking() *Updater

func (*Updater) Shutdown

func (u *Updater) Shutdown()

Jump to

Keyboard shortcuts

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