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

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