version

package
v0.0.0-...-29122af Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionUpgrade   versionChange = -1
	VersionSame      versionChange = 0
	VersionDowngrade versionChange = 1
	VersionUnknown   versionChange = 2
)

Variables

This section is empty.

Functions

func CompareVersions

func CompareVersions(fromVersion, toVersion string) versionChange

CompareVersions compares two semver versions if fromVersion is older than toVersion, returns versionOlder likewise, if fromVersion is newer, returns versionNewer

func Get

func Get() version.Info

Get returns the overall codebase version. It's for detecting what code a binary was built from.

func IsVersionGreaterThanOrEqualTo

func IsVersionGreaterThanOrEqualTo(version string, major int, minor int) bool

IsVersionGreaterThanOrEqualTo returns true if given version string in greater than or equal to major.min version, otherwise returns false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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