selfupdater

package
v0.0.0-...-43a96cf Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NextExecutable

type NextExecutable struct {
	Version string
	Cmd     *exec.Cmd
}

NextExecutable represents the next command to execute when self upgrading. If one is not available, Available() will return false

func (*NextExecutable) Available

func (nextExe *NextExecutable) Available() bool

Available returns true if a next executable can be run

func (*NextExecutable) ReExec

func (nextExe *NextExecutable) ReExec(extraEnv []string) error

ReExec runs the next executable and exits. This function panics if a a next executable is not available. It is the caller's responsibility to verify that with the Available() function

type SelfUpdater

type SelfUpdater interface {
	// NextExecutable returns the next executable to exec if one is available.
	// One not being available is not considered an error
	NextExecutable(ctx context.Context) (NextExecutable, error)
}

SelfUpdater gets the updated executables

func NewSelfUpdater

func NewSelfUpdater(updateSource updatesource.UpdateSource, executableCache executablecache.ExecutableCache) SelfUpdater

NewSelfUpdater returns a new self updater. It will fetch updates from the update source and store them in the given executable cache

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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