update

package
v1.13.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownVersion = errors.New("unknown version")

Functions

This section is empty.

Types

type LatestVersion added in v1.9.3

type LatestVersion struct {
	// The channel the release is from
	Channel version.ReleaseChannel `json:"channel"`

	// Whether the requested target is supported or not
	Supported bool `json:"supported"`

	// The latest version available
	// Access via Version() to ensure the version is prefixed with "v" for GA releases
	RawVersion string `json:"version"`

	// The URL for that version (if supported)
	URL string `json:"url,omitempty"`

	// Whether the version contains a security fix from the current version running
	SecurityUpdate bool `json:"security_update"`

	// Optional notes about what the security update fixes and why the user should install it
	SecurityNotes string `json:"security_notes,omitempty"`

	// If we need to force an upgrade. This is only used for security updates and only for
	// the most urgent ones, i.e we should never use it unless the world is on fire.
	ForceUpgrade bool `json:"force_upgrade,omitempty"`
}

LatestVersion contains the parsed response from the update server

func Check

func Check(ctx context.Context) (latestVersion *LatestVersion, err error)

Check checks for the latest Encore version. It reports ErrUnknownVersion if it cannot determine the version.

func (*LatestVersion) DoUpgrade added in v1.9.3

func (lv *LatestVersion) DoUpgrade(stdout, stderr io.Writer) error

DoUpgrade upgrades Encore.

Adapted from flyctl: https://github.com/superfly/flyctl

func (*LatestVersion) IsNewer added in v1.9.3

func (lv *LatestVersion) IsNewer(current string) bool

IsNewer returns true if LatestVersion is newer than current

This is safe to call on a nil LatestVersion

func (*LatestVersion) Version added in v1.9.3

func (lv *LatestVersion) Version() string

Version returns the version string referenced by the LatestVersion. ensuring that it is prefixed with "v" for GA releases.

Jump to

Keyboard shortcuts

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