update

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decision

type Decision struct {
	CurrentVersion      string `json:"current_version"`
	LatestVersion       string `json:"latest_version"`
	MinSupportedVersion string `json:"min_supported_version"`
	MetadataSource      string `json:"metadata_source,omitempty"`

	StrictDisabled  bool `json:"strict_disabled"`
	DevBuild        bool `json:"dev_build"`
	HasNewerVersion bool `json:"has_newer_version"`
	Blocked         bool `json:"blocked"`
}

Decision describes how the CLI should behave given the current / remote versions.

func Check

func Check(resolved *appconfig.Resolved) (Decision, error)

Check resolves the effective version policy (including config + env overrides), loads remote metadata with caching, and returns the decision for the current awiki-cli binary.

This function is intentionally tolerant: - Network / cache errors never crash the CLI; callers can choose how hard to fail. - When metadata is missing or unparsable, the Decision falls back to "no block".

func CheckFresh

func CheckFresh(ctx context.Context, resolved *appconfig.Resolved) (Decision, error)

CheckFresh behaves like Check, but for explicit user-initiated upgrade flows it prefers fresh network metadata and falls back to cached metadata only when both registries are unavailable.

type Metadata

type Metadata struct {
	LatestVersion       string    `json:"latest_version"`
	MinSupportedVersion string    `json:"min_supported_version"`
	RetrievedAt         time.Time `json:"retrieved_at"`
	Source              string    `json:"source"` // "network" | "cache" | "cache_stale"
}

Metadata captures the remote version strategy state that we cache locally.

Jump to

Keyboard shortcuts

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