version

package
v3.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MPL-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "3.8.1"

Version represents the value of the current semantic version.

Functions

func AIsNewerThanB

func AIsNewerThanB(A, B string) (bool, error)

AIsNewerThanB compares two semantic versions and returns true if A is newer than B. The function will return an error if either version is not a valid semantic version.

func PrintVersion

func PrintVersion(c *cli.Context)

PrintVersion prints the current version of sops. If the flag `--disable-version-check` is set, the function will not attempt to retrieve the latest version from the GitHub API.

If the flag is not set, the function will attempt to retrieve the latest version from the GitHub API and compare it to the current version. If the latest version is newer, the function will print a message to stdout.

func RetrieveLatestReleaseVersion

func RetrieveLatestReleaseVersion() (tag, url string, err error)

RetrieveLatestReleaseVersion fetches the latest release version from GitHub. Returns the latest version as a string and the release URL, or an error if the request failed or the response could not be parsed.

The function first attempts redirection-based retrieval (HTTP 301). It's preferred over GitHub API due to no rate limiting, but may break on redirect changes. If the first attempt fails, it falls back to the GitHub API.

Unlike RetrieveLatestVersionFromUpstream, it returns the tag (e.g. "v3.7.3").

func RetrieveLatestVersionFromUpstream deprecated

func RetrieveLatestVersionFromUpstream() (string, error)

RetrieveLatestVersionFromUpstream retrieves the most recent release version from GitHub. The function returns the latest version as a string, or an error if the request fails or the response cannot be parsed.

Deprecated: This function is deprecated in favor of RetrieveLatestReleaseVersion, which also provides the URL of the latest release.

Types

This section is empty.

Jump to

Keyboard shortcuts

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