github

package
v2.8.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2018 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Updater

type Updater struct {
	HTTPClient     *http.Client
	RequestTimeout time.Duration
	Context        context.Context
	Filename       string
	// contains filtered or unexported fields
}

Updater is the core struct of the update library holding all configurations

func NewUpdater

func NewUpdater(repo, myVersion string) (*Updater, error)

NewUpdater initializes a new Updater and tries to guess the Filename

func (*Updater) Apply

func (u *Updater) Apply() error

Apply downloads the new binary from Github, fetches the SHA256 sum from the SHA256SUMS file and applies the update to the currently running binary

func (*Updater) HasUpdate

func (u *Updater) HasUpdate(forceRefresh bool) (bool, error)

HasUpdate checks which tag was used in the latest version and compares it to the current version. If it differs the function will return true. No comparison is done to determine whether the found version is higher than the current one.

Jump to

Keyboard shortcuts

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