version

package
v0.0.0-...-e748ce7 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidVersion      = errors.New("invalid version string")
	ErrIncomparableVersion = errors.New("incomparable: dev version")

	ErrInvalidHarvesterVersion       = errors.New("invalid harvester version")
	ErrMinUpgradeRequirement         = errors.New("current version does not meet minimum upgrade requirement")
	ErrDowngrade                     = errors.New("downgrading is prohibited")
	ErrDevUpgrade                    = errors.New("upgrading from dev versions to non-dev versions is prohibited")
	ErrPrereleaseCrossVersionUpgrade = errors.New("cross-version upgrades from/to any prerelease version are prohibited")
)

Functions

This section is empty.

Types

type HarvesterUpgradeVersion

type HarvesterUpgradeVersion struct {
	// contains filtered or unexported fields
}

func NewHarvesterUpgradeVersion

func NewHarvesterUpgradeVersion(cv, uv, mv *HarvesterVersion) *HarvesterUpgradeVersion

func (*HarvesterUpgradeVersion) CheckUpgradeEligibility

func (u *HarvesterUpgradeVersion) CheckUpgradeEligibility(strictMode bool) error

func (*HarvesterUpgradeVersion) IsUpgradable

func (u *HarvesterUpgradeVersion) IsUpgradable() error

IsUpgradable checks that whether the current version satisfies the minimum upgrade requirement.

func (*HarvesterUpgradeVersion) IsUpgrade

func (u *HarvesterUpgradeVersion) IsUpgrade() error

type HarvesterVersion

type HarvesterVersion struct {
	// contains filtered or unexported fields
}

func NewHarvesterVersion

func NewHarvesterVersion(versionStr string) (*HarvesterVersion, error)

func (*HarvesterVersion) GetStableVersion

func (v *HarvesterVersion) GetStableVersion() *HarvesterVersion

GetStableVersion returns the Version object without the suffix. For example, given "v1.2.2-rc1", it returns "v1.2.2"

func (*HarvesterVersion) IsEqual

func (v *HarvesterVersion) IsEqual(version *HarvesterVersion) (bool, error)

func (*HarvesterVersion) IsNewer

func (v *HarvesterVersion) IsNewer(version *HarvesterVersion) (bool, error)

func (*HarvesterVersion) IsOlder

func (v *HarvesterVersion) IsOlder(version *HarvesterVersion) (bool, error)

func (*HarvesterVersion) String

func (v *HarvesterVersion) String() string

Jump to

Keyboard shortcuts

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