Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultClient *http.Client
DefaultClient is the HTTP client used for npm registry requests. Override in tests with an httptest server client.
Functions ¶
func FetchManifest ¶ added in v1.0.98
func FetchManifest(ctx context.Context, src distribution.Source) (*distribution.Manifest, errs.TypedError)
FetchManifest fetches the configured manifest and records its target in the update cache. Callers should use this entry point instead of fetching a manifest directly so a successful explicit check resets the cache TTL.
func RefreshCache ¶
RefreshCache fetches the configured target and updates the local cache. No-op if the cache is still fresh (< 24h). Safe to call from a goroutine.
func SetPending ¶
func SetPending(info *UpdateInfo)
SetPending stores the update info for consumption by output decorators.
Types ¶
type Target ¶ added in v1.0.98
Target describes the active source's desired CLI version.
func FetchTarget ¶ added in v1.0.98
FetchTarget synchronously queries the active update source and refreshes the local cache. It is intended for explicit checks such as update and doctor.
func FetchTargetForSource ¶ added in v1.0.98
FetchTargetForSource queries an already-resolved source, refreshes the local cache, and does not consult the extension registry again.
type UpdateInfo ¶
type UpdateInfo struct {
Current string `json:"current"`
Latest string `json:"latest"`
Source string `json:"source,omitempty"`
}
UpdateInfo holds version update information.
func CheckCached ¶
func CheckCached(ctx context.Context, currentVersion string) *UpdateInfo
CheckCached checks the local cache only (no network). Always fast.
func (*UpdateInfo) Message ¶
func (u *UpdateInfo) Message() string
Message returns a concise update notification including the canonical fix command. Aligned with skillscheck.StaleNotice.Message style so AI agents can parse a unified "run: lark-cli update" hint across both notice types.