update

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTestOverrides

func SetTestOverrides(client *http.Client, apiBaseURL, downloadBaseURL string, execFn func() (string, error)) func()

SetTestOverrides overrides package-level settings for external test packages. Returns a cleanup function that restores the originals.

func WriteCacheAfterUpdate

func WriteCacheAfterUpdate(latestVersion string)

WriteCacheAfterUpdate updates the cache so a stale notification isn't shown after an update.

Types

type CheckResult

type CheckResult struct {
	CurrentVersion string
	LatestVersion  string
}

CheckResult holds the outcome of a version check.

func CheckForUpdate

func CheckForUpdate(currentVersion string) *CheckResult

CheckForUpdate checks whether a newer version of pacto is available. Returns nil if version is "dev", on any error, or if already up-to-date.

type PluginUpdateResult added in v0.17.0

type PluginUpdateResult struct {
	Name    string
	Version string
}

PluginUpdateResult holds the outcome of a single plugin update.

func UpdatePlugins added in v0.17.0

func UpdatePlugins() ([]PluginUpdateResult, error)

UpdatePlugins discovers installed pacto plugins and updates them to the latest version.

type UpdateResult

type UpdateResult struct {
	PreviousVersion string
	NewVersion      string
}

UpdateResult holds the outcome of a self-update.

func Update

func Update(currentVersion, targetVersion string) (*UpdateResult, error)

Update downloads and installs the specified version of pacto. If targetVersion is empty, it fetches the latest release.

Jump to

Keyboard shortcuts

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