updatepolicy

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OptionalUpdateTTL = 24 * time.Hour
)

Variables

This section is empty.

Functions

func ClearOptionalUpdateAttempt

func ClearOptionalUpdateAttempt() error

ClearOptionalUpdateAttempt removes the optional update cache entry, if it exists.

func ReadOptionalUpdateAttempt

func ReadOptionalUpdateAttempt() (time.Time, error)

ReadOptionalUpdateAttempt returns the timestamp of the last optional update attempt. If no attempt has been recorded, the returned time is zero.

func WriteOptionalUpdateAttempt

func WriteOptionalUpdateAttempt(ts time.Time) error

WriteOptionalUpdateAttempt records the provided timestamp as the last optional update attempt.

Types

type Result

type Result struct {
	CurrentVersion string
	LatestVersion  string
	LatestTag      string
	MinVersion     string

	Mandatory bool
	Optional  bool
	Reason    string

	AssetURL       string
	ChecksumURL    string
	ExpectedSHA256 string
}

Result captures the outcome of the update policy evaluation.

func Check

func Check(ctx context.Context, currentVersion string, force bool) (Result, error)

Check evaluates whether the CLI needs to update, using cached metadata when possible. If force is true, cached values are ignored and fresh network calls are made.

Jump to

Keyboard shortcuts

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