Documentation
¶
Index ¶
- func CheckWithConfig(ctx context.Context, p *core.Printer, timeout time.Duration, silent bool, ...) int
- func ConfigureDetachedProcess(cmd *exec.Cmd)
- func ShouldAttemptUpdate(ctx context.Context, p *core.Printer, dur time.Duration) (bool, error)
- func Update(ctx context.Context, p *core.Printer, timeout time.Duration, silent bool, ...) int
- func UpdateWithConfig(ctx context.Context, p *core.Printer, timeout time.Duration, silent bool, ...) int
- type Asset
- type NetworkConfig
- type Release
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
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
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 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.