updater

package
v0.0.0-...-41e44c1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: BSD-3-Clause Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CfgKeyInstallVersion = "state_tool_installer_version"
	InstallerName        = "state-installer" + osutils.ExeExtension
)
View Source
const CfgUpdateTag = "update_tag"

Variables

This section is empty.

Functions

This section is empty.

Types

type AvailableUpdate

type AvailableUpdate struct {
	Channel  string  `json:"channel"`
	Version  string  `json:"version"`
	Platform string  `json:"platform"`
	Path     string  `json:"path"`
	Sha256   string  `json:"sha256"`
	Tag      *string `json:"tag,omitempty"`
}

func NewAvailableUpdate

func NewAvailableUpdate(channel, version, platform, path, sha256, tag string) *AvailableUpdate

func NewAvailableUpdateFromGraph

func NewAvailableUpdateFromGraph(au *graph.AvailableUpdate) *AvailableUpdate

func (*AvailableUpdate) Equals

func (u *AvailableUpdate) Equals(origin *Origin) bool

func (*AvailableUpdate) IsValid

func (u *AvailableUpdate) IsValid() bool

type Checker

type Checker struct {
	InvocationSource InvocationSource
	// contains filtered or unexported fields
}

func NewChecker

func NewChecker(cfg Configurable, an analytics.Dispatcher, infoURL string, httpget *retryhttp.Client) *Checker

func NewDefaultChecker

func NewDefaultChecker(cfg Configurable, an analytics.Dispatcher) *Checker

func (*Checker) CheckFor

func (u *Checker) CheckFor(desiredChannel, desiredVersion string) (*AvailableUpdate, error)

type Configurable

type Configurable interface {
	GetString(string) string
	Set(string, interface{}) error
}

type ErrorInProgress

type ErrorInProgress struct{ *locale.LocalizedError }

type Fetcher

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

func NewFetcher

func NewFetcher(an analytics.Dispatcher) *Fetcher

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(update *UpdateInstaller, targetDir string) error

type InvocationSource

type InvocationSource string
var (
	InvocationSourceInstall InvocationSource = "install"
	InvocationSourceUpdate  InvocationSource = "update"
)

type Origin

type Origin struct {
	Channel string
	Version string
}

func NewOriginDefault

func NewOriginDefault() *Origin

type UpdateInstaller

type UpdateInstaller struct {
	AvailableUpdate *AvailableUpdate
	Origin          *Origin
	// contains filtered or unexported fields
}

func NewUpdateInstaller

func NewUpdateInstaller(an analytics.Dispatcher, avUpdate *AvailableUpdate) *UpdateInstaller

func NewUpdateInstallerByOrigin

func NewUpdateInstallerByOrigin(an analytics.Dispatcher, origin *Origin, avUpdate *AvailableUpdate) *UpdateInstaller

NewUpdateInstallerByOrigin returns an instance of Update. Allowing origin to be set is useful for testing.

func (*UpdateInstaller) DownloadAndUnpack

func (u *UpdateInstaller) DownloadAndUnpack() (string, error)

func (*UpdateInstaller) InstallBlocking

func (u *UpdateInstaller) InstallBlocking(installTargetPath string, args ...string) (rerr error)

func (*UpdateInstaller) InstallWithProgress

func (u *UpdateInstaller) InstallWithProgress(installTargetPath string, progressCb func(string, bool)) (*os.Process, error)

InstallWithProgress will fetch the update and run its installer Leave installTargetPath empty to use the default/existing installation path

func (*UpdateInstaller) ShouldInstall

func (u *UpdateInstaller) ShouldInstall() bool

Jump to

Keyboard shortcuts

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