update

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckWithConfig added in v0.28.0

func CheckWithConfig(ctx context.Context, p *core.Printer, timeout time.Duration, silent bool, network NetworkConfig) int

CheckWithConfig checks the latest release without downloading or replacing the executable. It uses the same bounded HTTPS and operational network policy as an explicit update.

func ConfigureDetachedProcess added in v0.28.0

func ConfigureDetachedProcess(cmd *exec.Cmd)

ConfigureDetachedProcess gives the updater its own session and process group. It therefore does not receive terminal-generated signals sent to the initiating command's session.

func ShouldAttemptUpdate added in v0.8.0

func ShouldAttemptUpdate(ctx context.Context, p *core.Printer, dur time.Duration) (bool, error)

ShouldAttemptUpdate returns true if the application has not checked for an update within dur. Metadata is advisory state. A corrupt, stale, future, or symlinked metadata file is treated as a due check instead of blocking the requested fetch operation.

func Update

func Update(ctx context.Context, p *core.Printer, timeout time.Duration, silent bool, dryRun bool) int

Update checks the API for the latest fetch version and upgrades the current executable in-place, returning the exit code to use. It retains the legacy entry point for callers that do not need custom network policy.

func UpdateWithConfig added in v0.28.0

func UpdateWithConfig(ctx context.Context, p *core.Printer, timeout time.Duration, silent bool, dryRun bool, network NetworkConfig) int

UpdateWithConfig applies the caller's resolver, proxy, CA, and connect timeout policy to metadata and artifact downloads. It does not inherit origin-specific authentication or TLS weakening settings.

Types

type Asset added in v0.5.0

type Asset struct {
	Name string `json:"name"`
	URL  string `json:"browser_download_url"`
}

type NetworkConfig added in v0.28.0

type NetworkConfig struct {
	CACerts          []*x509.Certificate
	ConnectTimeout   time.Duration
	ResolverEndpoint *resolver.Endpoint
	DNSServer        *url.URL
	Proxy            *url.URL
}

NetworkConfig contains the operational network policy that is safe to carry into update requests. Origin credentials, client certificates, insecure TLS, and forced protocol settings are intentionally excluded.

type Release added in v0.5.0

type Release struct {
	TagName string  `json:"tag_name"`
	Assets  []Asset `json:"assets"`
}

Jump to

Keyboard shortcuts

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